mirror of https://github.com/sveltejs/svelte
parent
26e3286899
commit
02a30b5602
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: mark reactions of `MAYBE_DIRTY` reactions too
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
let {config, value = $bindable()} = $props();
|
||||
|
||||
$effect.pre(() => {
|
||||
config;
|
||||
value = {}
|
||||
});
|
||||
</script>
|
||||
|
||||
a
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
let {config, value = $bindable()} = $props();
|
||||
|
||||
$effect.pre(() => {
|
||||
config;
|
||||
value = {}
|
||||
});
|
||||
</script>
|
||||
|
||||
b
|
@ -0,0 +1,14 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: '<button></button> a',
|
||||
async test({ assert, target }) {
|
||||
const btn = target.querySelector('button');
|
||||
flushSync(() => {
|
||||
btn?.click();
|
||||
});
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `<button></button> b`);
|
||||
}
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
<script>
|
||||
import A from "./A.svelte";
|
||||
import B from "./B.svelte";
|
||||
|
||||
let schema = $state("any");
|
||||
let value = $state({});
|
||||
|
||||
let config = $derived.by(() => {
|
||||
value;
|
||||
return schema;
|
||||
});
|
||||
|
||||
let Thing = $derived.by(() => {
|
||||
console.log("comp", config);
|
||||
return config === "any" ? A : B;
|
||||
});
|
||||
</script>
|
||||
|
||||
<button onclick={()=>{
|
||||
schema = "one";
|
||||
}}></button>
|
||||
|
||||
<Thing {config} bind:value/>
|
Loading…
Reference in new issue