vuejs / vuejs/docs

Vague: "If an object is assigned as a ref's value, the object is made deeply reactive with reactive(). "

Open
#2,310 3 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.