chat-ui-3.0 / src /lib /components /Portal.svelte
Toaster496's picture
Duplicate from huggingchat/chat-ui
3ea9478
raw
history blame contribute delete
312 Bytes
<script lang="ts">
import { onMount, onDestroy } from "svelte";
let el: HTMLElement;
onMount(() => {
el.ownerDocument.body.appendChild(el);
});
onDestroy(() => {
if (el?.parentNode) {
el.parentNode.removeChild(el);
}
});
</script>
<div bind:this={el} class="contents" hidden>
<slot />
</div>