Skip to content

Commit 347b1d1

Browse files
committed
Merge pull request #13663 from j3rem1e/fixes-duplicate-preview
Svelte: Fix duplicate story preview
1 parent c646e33 commit 347b1d1

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
<script>
2-
import { onMount } from 'svelte';
3-
42
export let component;
53
export let props;
6-
let child;
7-
8-
const hash = `svelte mounter ${Math.floor(Math.random() * 100)}`;
9-
10-
onMount(() => {
11-
child = new component({
12-
target: document.getElementById(hash),
13-
props,
14-
});
15-
});
164
</script>
175

186
<svelte:options accessors={true} />
19-
<div id={hash} />
7+
<svelte:component this={component} {...props}/>

0 commit comments

Comments
 (0)