mirror of https://github.com/sveltejs/svelte
parent
036d4588ab
commit
e648e423d4
@ -1,11 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import B from './B.svelte';
|
import B from './B.svelte';
|
||||||
|
|
||||||
let { boolean, closed } = $props();
|
let { boolean, closed, close } = $props();
|
||||||
|
|
||||||
|
// this runs after the effect in B, because child effects run first
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
console.log(boolean);
|
console.log(boolean, closed);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<B {closed} />
|
<B {closed} {close} />
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<script module>
|
|
||||||
let object = $state();
|
|
||||||
|
|
||||||
export function open() {
|
|
||||||
object = { boolean: true };
|
|
||||||
}
|
|
||||||
|
|
||||||
export function close() {
|
|
||||||
object = undefined;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let { children } = $props();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if object?.boolean}
|
|
||||||
<!-- error occurs here, this is executed when the if should already make it falsy -->
|
|
||||||
{@render children(object.boolean)}
|
|
||||||
{/if}
|
|
Loading…
Reference in new issue