Closed
Description
Describe the bug
In #13142 logic was added that snapshots state proxies for logging.
The state is deeply evaluated without untrack
which can lead to different $effect
behavior in dev.
(Promoted my comment to an issue so it's not lost)
Reproduction
<script>
let count = $state({ value: 0 });
function increment() {
count.value += 1;
}
$effect(() => {
console.log('triggered on mutation', count);
});
$effect(() => {
count;
console.log('not triggered on mutation');
});
</script>
<button onclick={increment}>
clicks: {count.value}
</button>
<button onclick={() => count = { value: 0 }}>
Reset via object assignment
</button>
Logs
No response
System Info
REPL
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels