-
Notifications
You must be signed in to change notification settings - Fork 47k
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
unify deprecated/unsafe lifecycle warnings, pass tests #16103
unify deprecated/unsafe lifecycle warnings, pass tests #16103
Conversation
Details of bundled changes.Comparing: 9f39590...9505272 react-art
react-dom
react-test-renderer
react-reconciler
react-native-renderer
Generated by 🚫 dangerJS |
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.
These lifecycles are actually deprecated and will be removed in the next major version. I think changing the message to "not recommended" is a mistake.
Edit for clarity I think it's okay to say
Using UNSAFE_componentWillMount in strict mode is not recommended
But I don't think it's good to say:
Using componentWillMount in strict mode is not recommended
I think our warning needs to be more than just "not recommended" because the idea is that it will stop working in a future version.
Good point, happy to change it |
How do you feel about “...has been renamed to...”? I’m only trying to avoid the word ‘deprecated’. |
I am okay with "has been renamed to" in addition to advising against its usage. |
fd7faef
to
c1d0e06
Compare
I updated the diff only to pass the build error, will continue tweaking the wording. Still not 100% sure yet tbh. |
ec7b480
to
e7127aa
Compare
1c57951
to
d41920b
Compare
packages/react-reconciler/src/__tests__/ReactIncremental-test.internal.js
Outdated
Show resolved
Hide resolved
abe5f20
to
e296fc4
Compare
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.
The usage of the phrase "(preferred in most cases)"
seems unnecessary and confusing to me. What cases? Why are they preferred in some cases but not others?
I think it's important we get this right, otherwise we're just going to cause pain for quite a large segment of users who are upgrading from an older version.
packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
Outdated
Show resolved
Hide resolved
packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
Outdated
Show resolved
Hide resolved
updated messages, screenshot. |
This PR tweaks the deprecated/unsafe lifecycle warnings.
warnAboutDeprecatedLifecycles
for the test renderer. I think we missed doing so it previously. In a future PR, I'll remove the feature flag altogether.Things to do in future PRs asap -
Screenshot: