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

Describe the bug The following warning is shown upon upgrading to React 16.9.0:

 console.warn node_modules/react-dom/cjs/react-dom.development.js:11494
      Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

      * Move data fetching code or side effects to componentDidUpdate.
      * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
      * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps 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: BootstrapTable, BootstrapTableContainer, DataProvider, PaginationDataProvider, PaginationHandler, SearchBar, SearchProvider

To Reproduce Steps to reproduce the behavior:

  1. Update app to React 16.9.0+
  2. Run the app and open devtools (or run your tests)
  3. See warning

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
chimericdreamcommented, Aug 12, 2019

If you like, I can submit a PR that renames the deprecated methods to eliminate the warning.

0reactions
AllenFangcommented, Sep 8, 2019

Thanks @chimericdream’s help 🎉

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

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