style: format code for consistency and readability in sileo-toast component
This commit is contained in:
1 parent
62f03cf7c0
commit
1fc0391113
1 file changed
+11
-11
@@ -1,21 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createElement } from 'react'
|
import { createElement } from 'react';
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client';
|
||||||
import type { SileoOptions } from 'sileo'
|
import type { SileoOptions } from 'sileo';
|
||||||
|
|
||||||
let props: SileoOptions = $props()
|
let props: SileoOptions = $props();
|
||||||
let rootEl: HTMLElement
|
let rootEl: HTMLElement;
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const root = createRoot(rootEl)
|
const root = createRoot(rootEl);
|
||||||
|
|
||||||
import('sileo').then(({ Toaster }) => {
|
import('sileo').then(({ Toaster }) => {
|
||||||
const sileo = createElement(Toaster, { ...props })
|
const sileo = createElement(Toaster, { ...props });
|
||||||
root.render(sileo)
|
root.render(sileo);
|
||||||
})
|
});
|
||||||
|
|
||||||
return () => root.unmount()
|
return () => root.unmount();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div bind:this={rootEl}></div>
|
<div bind:this={rootEl}></div>
|
||||||
Reference in new issue
Block a user