In my custom component, I had an html string from a 3rd party library (which I have write-access to the source code). I wanted to put <slot></slot> inside the body of that html fragment.
The html string from the 3rd party library might look like:
<div>
<!-- <slot></slot> is supposed to be here -->
</div>
MyComponent.svelte:
<script>
$: htmlString = lib.getHtmlFragment(/* optional body html*/);
</script>
{@html htmlString}
<!-- How do I put slots inside the htmlString -->
App.svelte:
<MyComponent>
<input bind:value />
</MyComponent>
So, how can I put the <slot></slot> wrapped inside the {@html htmlString} without losing the slot's reactivity?