Vague: "If an object is assigned as a ref's value, the object is made deeply reactive with reactive(). "
Nobody has claimed this yet.
- Dominant language
- Vue
- Stars
- 3.2k
- Forks
- 5k
- Avg merge
- 14d 17h
- Merged PRs (30d)
- 1
Description
Vue version
current
Link to minimal reproduction
ttps://vuejs.org/api/reactivity-core.html#ref
Steps to reproduce
Could you please clarify: "If an object is assigned as a ref's value, the object is made deeply reactive with reactive()."
Does this mean just const obj = ref({deep: {ref: 1}}) or this too obj.value = {deep: {ref: 1}}? I think this should say at a minimum: "If an object is assigned as a ref's value when constructed, the object is made deeply reactive with reactive()." because in my testing, assigning after the fact directly to value does not appear to wrap the properties in a proxy.
https://vuejs.org/api/reactivity-core.html#ref
What is expected?
Docs should cover all cases..
What is actually happening?
Ended up guessing.
System Info
No response
Any additional comments?
Great API and the docs are actually very good.
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 with the ref API documentation at the linked vuejs.org URL and compare the documented construction and later-assignment cases described in the issue. Confirm the behavior for both examples, then update the wording so the relevant cases and expected reactivity are unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100