pull/6759/head
Conduitry 5 years ago
parent fecc15fc8b
commit ef69d10a72

@ -0,0 +1,6 @@
<script>
import { getContext } from 'svelte';
const value = getContext('foo');
</script>
<div>Value in child component: {value}</div>

@ -0,0 +1,6 @@
export default {
skip_if_ssr: true,
html: `
<div><div>Value in child component: undefined</div></div>
`
};

@ -0,0 +1,15 @@
<script>
import { setContext } from 'svelte';
import ChildComponent from './ChildComponent.svelte';
setContext('foo', true);
function render(node) {
new ChildComponent({
target: node,
context: new Map()
});
}
</script>
<div use:render />
Loading…
Cancel
Save