Deprecated lifecycle method warnings with React 16.9
See original GitHub issueThe following warning is shown upon upgrading to React 16.9.0:
Error: Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.
Please update the following components: Select in src/tests.entry.js (line 294578)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:121
- Comments:31 (7 by maintainers)
Top Results From Across the Web
React v16.9.0 and the Roadmap Update
Today we are releasing React 16.9. It contains several new features, bugfixes, and new deprecation warnings to help prepare for a future ...
Read more >What's new in React 16.9? - Programming with Mosh
React 16.9 Deprecations. 1. Warning when using old lifecycle names. The React team decided to deprecate some of the unsafe lifecycle methods ......
Read more >React: componentWillMount to be deprecated! - Northcoders
Starting with React v16.3.0, new versions of these methods categorised as unsafe have be created, and the legacy versions will come with deprecation...
Read more >react js project Warning: componentWillReceiveProps has ...
Run a single command as mentioned in the warning, to fix the deprecated lifecycle methods. px react-code mod rename-unsafe-lifecycles.
Read more >Warning: componentWillMount has been Renamed, and is not ...
Starting in React version 16.3, the following component lifecycle methods are being phased out. componentWillMount; componentWillReceiveProps ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
oh sorry guys i was drunk when i made that comment
That means you have component using legacy lifecycle OR you are using a library which uses the legacy lifecycle, I don’t see this as an issue, in fact, it is helpful to identify legacy code and warn you when you do use libraries that do still.