Uh oh!
There was an error while loading. Please reload this page.
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.
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.
threepointone
commented
Jul 10, 2019
Good point, happy to change it |
threepointone
commented
Jul 10, 2019
How do you feel about “...has been renamed to...”? I’m only trying to avoid the word ‘deprecated’. |
bvaughn
commented
Jul 10, 2019
I am okay with "has been renamed to" in addition to advising against its usage. |
fd7faef to
c1d0e06Comparethreepointone
commented
Jul 11, 2019
I updated the diff only to pass the build error, will continue tweaking the wording. Still not 100% sure yet tbh. |
Uh oh!
There was an error while loading. Please reload this page.
ec7b480 to
e7127aaCompare1c57951 to
d41920bCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
abe5f20 to
e296fc4CompareThere was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
threepointone
commented
Jul 15, 2019
updated messages, screenshot. |
- redoes react#15431 from scratch, taking on the feedback there - unifies the messaging between "deprecated" and UNSAFE_ lifecycle messages. It reorganizes ReactStrictModeWarnings.js to capture and flush all the lifecycle warnings in one procedure each. - matches the warning from ReactPartialRenderer to match the above change - passes all the tests - this also turns on `warnAboutDeprecatedLifecycles` for the test renderer. I think we missed doing so it previously. In a future PR, I'll remove the feature flag altogether. - this DOES NOT do the same treatment for context warnings, I'll do that in another PR too
This PR tweaks the deprecated/unsafe lifecycle warnings.
warnAboutDeprecatedLifecyclesfor 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:
