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.

Deprecated lifecycle method warnings with React 16.9

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Reactions:121
  • Comments:31 (7 by maintainers)

github_iconTop GitHub Comments

198reactions
jairusdcommented, Aug 12, 2019

oh sorry guys i was drunk when i made that comment

37reactions
jairusdcommented, Aug 11, 2019

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.

Read more comments on GitHub >

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

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