Mutating props when it's an array and is assigned to a REF. #7163
Replies: 1 comment
-
|
vue's responsive is reflected in the data update triggering the view update, vue3's responsive is achieved through |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm a bit confusing with this behaviour, so decided to ask for some help.
The scenario is: We have two components parent and child.
Normally if you try to mutate the
propyou get an warning fromVueto avoid props mutation.But what happens when you assign a
propto a localrefand than mutate therefand that will also mutate thepropParent component
Child component
So pretty much this will mutate the
propwithout any warning and this is probably a anti-pattern ?Has todo with how the reactivity works behind the scenes.
Beta Was this translation helpful? Give feedback.
All reactions