-
Notifications
You must be signed in to change notification settings - Fork 47.9k
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
Warn when Using String Refs #16217
Warn when Using String Refs #16217
Conversation
Details of bundled changes.Comparing: 05dce75...fb04bc8 react-art
react-dom
react-test-renderer
react-reconciler
react-native-renderer
Generated by 🚫 dangerJS |
false, | ||
'Component "%s" contains the string ref "%s". Support for string refs ' + | ||
'will be removed in a future major release. We recommend using ' + | ||
'createRef() instead.' + |
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.
Maybe mention useRef
instead? Or at least also.
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.
Yeah it’s a common mistake to put createRef into a function component
As part of the process to deprecate string refs (as per a larger proposal outlined here), expand string ref warning to fire for everyone who uses string refs (not just people on strict mode) to notify them of planned deprecation changes.