Skip to content

Mention unwrapping of refs for readonly and shallow proxies #840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

skirtles-code
Copy link
Contributor

This is something that came out of a conversation on Discord.

The API reference for reactive already mentions that any ref properties will be automatically wrapped/unwrapped.

I've added a similar note to readonly. It's a simpler cases because the value can't be changed via a readonly proxy.

I've also added notes to shallowReactive and shallowReadonly. They don't have automatic unwrapping of ref, which came as a surprise to me. From looking at the source code it does appear to be a deliberate design decision for them to work that way.

@NataliaTepluhina NataliaTepluhina merged commit f956091 into vuejs:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants