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:

backend.js:1 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: Draggable

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

14reactions
bopfercommented, Aug 13, 2019

@STRML, Thanks for the quick fix for componentWillMount.

However, componentWillReceiveProps and componentWillUpdate are also deprecated. Sorry, I should have included those in my original comment.

1reaction
Patrickskibacommented, Aug 12, 2019

Please

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deprecated lifecycle method warnings with React 16.9 #3715
The following warning is shown upon upgrading to React 16.9.0: Error: Warning: componentWillMount has been renamed, and is not recommended ...
Read more >
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 >
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 >
move code with side effects to componentdidmount, and set initial ...
set initial react component state in constructor or componentWillMount? ... JedWatson/react-selectDeprecated lifecycle method warnings with React 16.9#3715.
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 >

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