You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is so by design - you just return the original object.
You should think about that code like this:
letinitial=[];// $state marks this variable and value as reactiveletmutable=initial;// $derived just re-assigns the value when dependecies changemutable.push({name: "something"});console.log(initial);// $inspect is kind of reactive console.log
Describe the bug
Code
Console
init (1) [ {…} ] 0: { name: "something" } length: 1
but it shouldn't mutate the original
initial
stateReproduction
Reproduction URL
Opoen this Svelte Playground link and open up the Playground's Console adn see the Intial State having the pushed item
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: