Skip to content

Commit

Permalink
Merge pull request #13663 from j3rem1e/fixes-duplicate-preview
Browse files Browse the repository at this point in the history
Svelte: Fix duplicate story preview
  • Loading branch information
shilman authored Jan 22, 2021
2 parents 856a35d + 5c63dc5 commit f89c14b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions addons/docs/src/frameworks/svelte/HOC.svelte
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
<script>
import { onMount } from 'svelte';
export let component;
export let props;
let child;
const hash = `svelte mounter ${Math.floor(Math.random() * 100)}`;
onMount(() => {
child = new component({
target: document.getElementById(hash),
props,
});
});
</script>

<svelte:options accessors={true} />
<div id={hash} />
<svelte:component this={component} {...props}/>

0 comments on commit f89c14b

Please sign in to comment.