-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add UNSAFE_ prefix to deprecated lifecycles
#3694
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
Conversation
|
I think this is the wrong approach.
It's obviously a bigger update, but I believe that will support React-15 and React-17 |
|
afaik, react 15 does not support You should change the |
17caf85 to
488535f
Compare
488535f to
984d821
Compare
|
fyi, i am currently working on a proper replacement of life cycle methods in my fork. This will then be able to use the react teams polyfill to remain compatible to react 15 or below. this is still a couple of days from being a proper PR, and even then i might need help with parts of the codebase. for that reason i am in favor of pushing the fix proposed here as a prerelease so people can at least get rid of noisy deprecation warning spam in their test output edit: #3702 |
|
We should not use |
pierreneter
left a comment
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.
Don't use UNSAFE_ prefix.
|
Hello, any update on this ? |
|
Closing this in favor of #3702, which I'm reviewing now |
Fixes #3361 (comment)
Checklist
[ ] Includes tests(Not sure what to test. Maybe a lint rule to prevent adding deprecated lifecycle in the future? But I can't find such rule intslint-react.)[ ] Update documentation(No documentation to update.)Changes proposed in this pull request:
As pointed by #3361 (comment), with React 16.9 released, there'll be a warning in the console for every deprecated lifecycle usage.
This PR fixes those warnings by adding
UNSAFE_prefix to every deprecated lifecycle.I think this is the best approach because it's the easiest way to solve the issue, and we can be certain it's not gonna break anything (which might be the case if we migrate to another lifecycle method). We can migrate all these
UNSAFE_lifecycles gradually later on.But this
UNSAFE_*lifecycle is not in React 15, so we'll have to drop support for it. Is this acceptable?I also renamed some jobs in the CI to reflect the change of dropping React 15, which makes the CI jobs name mismatched between GitHub and CircleCI.
test-react-16testtest-react-15test-iso-react-16test-isotest-iso-react-15Reviewers should focus on:
-react-15jobs from the workflow).test-react15package is removed.Screenshot
None