Basically, the title already says it all: In Vue.js 3, why do I have to use the value property on ref, but not on reactive?
I understand that ref is for simple values, such as booleans, numbers, …, and that reactive is for complex values such as objects and arrays. What I do not get is:
- Why do I need to specify
valuewhen I want to access aref's value, but not if I usereactive? Isn't this an inconsistency in the API, or is there an actual technical reason why it has to be this way? - Why am I not able to use one for both? In other words: Is there a technical reason why there isn't a single function which decides, depending on the type of the given value, how to wrap this internally?
I assume that I am missing something and it's not that easy. Can anyone help?