mirror of https://github.com/sveltejs/svelte
fix: ensure clearing of old values happens independent of root flushes (#15664)
* fix: ensure clearing of old values happens indepedent of root flushes * lint * testpull/15665/head
parent
5b9053d111
commit
80557bbc1c
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: ensure clearing of old values happens independent of root flushes
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
let thing = $state(0)
|
||||
|
||||
onMount(() => {
|
||||
thing = 1;
|
||||
return () => {
|
||||
console.log(thing);
|
||||
}
|
||||
})
|
||||
</script>
|
@ -0,0 +1,7 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
async test({ assert, logs }) {
|
||||
assert.deepEqual(logs, [1]);
|
||||
}
|
||||
});
|
@ -0,0 +1,14 @@
|
||||
<script>
|
||||
import { onMount } from "svelte"
|
||||
import Component from './Component.svelte';
|
||||
|
||||
let key = $state(0);
|
||||
|
||||
onMount(() => {
|
||||
key = 1;
|
||||
})
|
||||
</script>
|
||||
|
||||
{#key key}
|
||||
<Component />
|
||||
{/key}
|
Loading…
Reference in new issue