Skip to content

Commit 6c170ba

Browse files
committed
use render props
1 parent 918ce0f commit 6c170ba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/components/Modal.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script>
22
import { onMount } from 'svelte';
33
4-
/** @type {{ onclose?: () => void; children?: import('svelte').Snippet }}*/
5-
let { onclose } = $props();
4+
/** @type {{ onclose?: () => void; children: import('svelte').Snippet }}*/
5+
let { onclose, children } = $props();
66
77
/** @type {HTMLDialogElement} */
88
let modal;
@@ -45,7 +45,7 @@
4545
<div class="modal-background" />
4646
4747
<dialog class="modal" tabindex="-1" bind:this={modal} {onclose}>
48-
<slot />
48+
{@render children()}
4949
</dialog>
5050
5151
<style>

src/routes/+layout.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import '@sveltejs/site-kit/styles/index.css';
99
import '../app.css';
1010
11-
let { data } = $props();
11+
let { data, children } = $props();
1212
</script>
1313

1414
<Shell>
@@ -46,7 +46,7 @@
4646
</svelte:fragment>
4747
</Nav>
4848

49-
<slot />
49+
{@render children()}
5050
</Shell>
5151

5252
{#if browser}

0 commit comments

Comments
 (0)