useVuelidate breaks reactivity connection of object returned by a toRefs
See original GitHub issueThe codesandbox won’t compile due to some error with vue-demi, but I hope you can get the gist.
Providing an object obtained via toRefs
into useVuelidate
will break the connection between the original state and the generated refs. Was pretty painful to debug.
If the refs object is denstructured, everything works as expected. I tried to look into the source code, but could not understand where the problem lies
https://codesandbox.io/s/brave-raman-fex90?file=/src/App.vue
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
vue.js - What is the difference between ref, toRef and toRefs
A ref is a mechanism for reactivity in Vue 3. The idea is to wrap a non-object in a reactive object: Takes an...
Read more >Advanced usage - Vuelidate
useVuelidate returns a computed , so you need to use .value when accessing any of it's properties, like $error , $validate inside the...
Read more >Compose validation logics with Vue 3.0 and Vuelidate. - ITNEXT
One of the breaking change of Vue 3.0 is composition api. ... import { reactive, toRefs } from "@vue/composition-api";export default {
Read more >Vue 3: Reactivity Made Easy (ref, reactive, toRefs... oh my!)
Working with Vue 3 can be confusing if you don't understand how reactive variables work. In this video I explore all the basics...
Read more >Vue JS 3 Tutorial - 54 - Reactivity and toRefs - YouTube
Courses - https://learn.codevolution.dev/ Support UPI - https://support.codevolution.dev/ Support PayPal ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah… We have the main ways working, so I think that’s good for now
I see, I was reading there instead: https://vuelidate-next.netlify.app/advanced_usage.html#composition-api But I see you just updated that page too to show the reactive state usage.
The highlighted problem still holds btw, but I guess it’s intended behaviour or we’re in “won’t fix” realm