Are nested elements allowed in pinia #1099
-
Hi I am not sure if this is a bug or if it is intentionally working like that. Let say I have the following object: items: [
{
colors: [
{ value: true}
]
},
{
colors: [
{value: true}
]
}
] When i change lets say localhost_3000_undefined_custom-ilustrations.-.27.February.2022.mp4They look kind of linked as if I delte one of the with the devtools both are deleted |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It seems due to your Maybe you forgot to deeply clone it? For example, assuming you have an
Further reading: Immerjs is a library to help us solve this kind of problem in a elegant way. |
Beta Was this translation helpful? Give feedback.
It seems due to your
items[1].colors[0]
anditems[2].colors[0]
share the same object.Maybe you forgot to deeply clone it?
For example, assuming you have an
addItem
function like this:Further reading: Immerjs is a library to help us solve this kind of problem in a elegant way.