mirror of https://github.com/sveltejs/svelte
parent
5912754fd6
commit
fb6b40a0d0
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: don't fail on `flushSync` while flushing effects
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
let { text } = $props();
|
||||
|
||||
$effect(() => console.log(text));
|
||||
</script>
|
||||
|
||||
{text}
|
@ -0,0 +1,8 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, target, logs }) {
|
||||
assert.htmlEqual(target.innerHTML, `<button>show</button> <div>hello</div>`);
|
||||
assert.deepEqual(logs, ['hello']);
|
||||
}
|
||||
});
|
@ -0,0 +1,13 @@
|
||||
<script>
|
||||
import { flushSync, mount } from 'svelte'
|
||||
import Child from './Child.svelte';
|
||||
|
||||
let show = $state(false);
|
||||
</script>
|
||||
|
||||
<button onclick={() => show = true}>show</button>
|
||||
|
||||
<div {@attach (target) => {
|
||||
mount(Child, { target, props: { text: 'hello' } });
|
||||
flushSync();
|
||||
}}></div>
|
Loading…
Reference in new issue