Unsafe legacy lifecycles warning
See original GitHub issueI use the latest build of react and I get this warning in my console.
warning.js?6327:33 Warning: Unsafe legacy lifecycles will not be called for components using new component APIs.
Connect(LoadingBar) uses getDerivedStateFromProps() but also contains the following legacy lifecycles:
componentWillReceiveProps
componentWillUpdate
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
Warning `Unsafe legacy lifecycles will not be called ... - GitHub
Warning Unsafe legacy lifecycles will not be called for components ... (Considering the legacy React libraries still use them and can be ...
Read more >Unsafe legacy lifecycle methods should not ... - Rule | DeepScan
This rule applies when unsafe legacy lifecycle methods are defined together with newly added replacements. In React v16.3, componentWillMount() ...
Read more >Unsafe legacy lifecycles will not be called for components ...
I get this error with React v16.3: warning.js:33 Warning: Unsafe legacy lifecycles will not be called for components using new component APIs.
Read more >Suppressing legacy lifecycle method warnings in tests for ...
To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source ...
Read more >Strict Mode - React
Identifying components with unsafe lifecycles; Warning about legacy string ref API usage; Warning about deprecated findDOMNode usage; Detecting unexpected ...
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 FreeTop 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
Top GitHub Comments
I’m sorry I didn’t reply, Everything works fine now. Thanks
Hi @paschaldev , could you let us know on how did you solve your issue?
Below are my package dependencies: “react”: “^16.4.1”, “react-redux”: “^5.0.7”, “react-redux-loading-bar”: “^4.0.5”,
my full package.json can be found here: https://pastebin.com/V7ngu1xL