Skip to content

Commit

Permalink
add SSR test
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Sep 22, 2021
1 parent 23126c3 commit 6568bcb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { getContext } from 'svelte';
const value = getContext('foo');
</script>

<div>Value in child component: {value}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div><div>Value in child component: undefined</div></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script>
import { setContext } from 'svelte';
import ChildComponent from './ChildComponent.svelte';
setContext('foo', true);
const content = ChildComponent.render({}, { context: new Map() }).html;
</script>

<div>{@html content}</div>

0 comments on commit 6568bcb

Please sign in to comment.