DEV Community


Discussion on: Thought on Vue 3 Composition API - `reactive()` considered harmful

wormss profile image

Are the return types from ref().value recursive read-only?
Or are they still mutable? Are they reactive if so?

voluntadpear profile image
Guillermo Peralta Scura

ref.value is mutable, and if the inner value of your ref is an object it is deeply reactive. E.g.: = "5" will trigger any watcher on myObjectRef

Thread Thread
ycmjason profile image
Jason Yu Author

If it is a computed ref, then I believe it will be recursively read-only.

Forem Open with the Forem app