-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Rename refs to fix tons of 'Mutating a value' errors in react-compiler #64718
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: 0 B Total Size: 1.77 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke-tested the editors, and there were no errors. Hopefully, the e2e tests can catch anything we missed :)
Flaky tests detected in 282b986. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10509434142
|
Thanks @Mamaduka 🙌
Indeed. Linting is also helpful here though - if there's a missed instance to update inline, we'd immediately see errors. I'll do one more manual self-review before merging. |
Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
What?
This PR renames all refs we mutate to follow the ref naming pattern recommended in facebook/react#29916.
Why?
As part of #61788 we're working to experiment with
react-compiler
and early resolve any errors that can be blockers for using it.Renaming the refs to follow the naming pattern recommended in facebook/react#29916 takes care of 53 of the 140 lint errors.
I'm landing that as a separate improvement from #61788 to keep it minimal, but also because ref rename is pretty harmless on its own.
How?
We're renaming refs to follow the
somethingRef
pattern:const something = useRef()
becomesconst somethingRef = useRef()
const exampleRef = useRef()
remains unchangedTesting Instructions
Testing Instructions for Keyboard
None
Screenshots or screencast
None