-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 The bug
That code is watching an array but checking if the whole array is a string/number
devtools/packages/devtools/client/components/StateEditor.vue
Lines 44 to 50 in 5ce9b47
watch( | |
() => [props.revision, props.state], | |
(value) => { | |
if (typeof value !== 'number' && typeof value !== 'string') | |
deepSync(value, props.state) | |
else | |
proxy.value = props.state |
🛠️ To reproduce
https://stackblitz.com/~/github.com/kleinpetr/nuxt-playground/tree/devtools-usestate-reactivity
🌈 Expected behavior
If props.state is a primitive (like a number, string, boolean, etc.), use the else branch. If it’s an object or array, use the if branch and call deepSync.
ℹ️ Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working