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.

backend.js:1 Warning: componentWillReceiveProps has been renamed, and is not recommended for use

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

http://codepen.io/paranoidjk/pen/LWpaKe

Steps to reproduce

update package.json:

   "antd-mobile": "^2.3.1",
   "rc-form": "^2.4.8",
    "react": "^16.9.0",       
    "react-dom": "^16.9.0",
    "react-router-dom": "^5.0.1",
    "react-scripts": "^3.1.1",

What is expected?

no warning

What is actually happening?

got warning:

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

Environment Info
antd 2.3.0
React ^16.9.0
System windows 10
Browser Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.87 Safari/537.36

Update supports the react v16.x version

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
hopperhuangcommented, Apr 15, 2020

Is there a solution on this problem ? Countinue focusing on the issue.

3reactions
Boxser567commented, Mar 31, 2020

same as top.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - componentWillReceiveProps has been renamed
Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the ...
Read more >
Warning: componentWillReceiveProps has been ... - GitHub
componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
Read more >
Warning: componentWillMount has been Renamed, and is not ...
Warning : componentWillMount has been renamed, and is not recommended for use. Initializing state // Before class AppComponent extends React.
Read more >
componentWillReceiveProps has been renamed - React Studio
Move data fetching code or side effects to componentDidUpdate. · Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in ...
Read more >
react.dom error - WordPress.org
Warning : componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
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