question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unsafe legacy lifecycles warning

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
paschaldevcommented, May 15, 2018

I’m sorry I didn’t reply, Everything works fine now. Thanks

0reactions
James-Devcommented, Jul 19, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found