Skip to content

Update API entry for toRef to mention mutating props #1624

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
merged 1 commit into from
Mar 21, 2022

Conversation

skirtles-code
Copy link
Contributor

This is my attempt at addressing the concern raised in #1567.

The API entry for toRef mentions using it to create refs from props. This change attempts to clarify that the usual restriction on not mutating a prop still applies, using toRef is not a fix for that.

I've also made a few other tweaks to this entry:

  • It said string when it meant number.
  • An example wasn't importing toRef. Usually I wouldn't show the imports, but given the <script setup> tag was shown, I felt the import should be shown too.
  • The final note about using toRef with optional properties was added back when props did not include omitted values. That has since been changed, so props now includes all props, even if they aren't passed. I've reworded that note to avoid mentioning props.

@netlify
Copy link

netlify bot commented Mar 17, 2022

✔️ Deploy Preview for vuejs ready!

🔨 Explore the source changes: 52913a8

🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs/deploys/623384bed505fe00088b10b2

😎 Browse the preview: https://deploy-preview-1624--vuejs.netlify.app

Copy link
Member

@NataliaTepluhina NataliaTepluhina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @skirtles-code! Looks good to me 👍🏻

@NataliaTepluhina NataliaTepluhina merged commit 0f69aba into vuejs:main Mar 21, 2022
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