Add a remark about watching objects/array refs
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 3.2k
- Forks
- 5k
- Avg merge
- 14d 17h
- Merged PRs (30d)
- 1
Description
From the docs at least for me it's not obvious that watching a ref is actually shallow watching its value only.
The problem that we know that an object/array ref makes the object/array accessed through the ref's value reactive.
So intuitively it could seem that watching an object/array ref is deep like watching a reactive variable, but it's not.
I think a remark about this case should be added in the docs, otherwise I see periodically that kind of questions on the stackoverflow:
https://stackoverflow.com/questions/76786334/cannot-watch-an-array-ref-in-vue-3/76786671
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by finding the Vue 3 documentation section that explains watch sources, refs, and deep watching, then compare its wording with the linked Stack Overflow question. Add a remark clarifying that watching an object or array ref watches its value shallowly, and verify that the surrounding guidance remains accurate.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100