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.

Getting waring in React 16.8.6 about ComponentWillRecieveProps

See original GitHub issue

The warinig is as follows:

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:75
  • Comments:34 (4 by maintainers)

github_iconTop GitHub Comments

28reactions
sakstonecommented, Jul 14, 2021

Hi Guys,

it looks like it is still a open issue? Are there any plans to fix it?

[Error] Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles 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://reactjs.org/link/derived-state

Please update the following components: ReactSwipableView
17reactions
Uttu316commented, Sep 21, 2019

Still facing problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

get warning "componentWillReceiveProps has been renamed ...
This is a warning from react native. componentWillReceiveProps is a synchronous hook. Calling asynchronous function like data fetching ...
Read more >
Legacy Context - React
The problem is, if a context value provided by component changes, descendants that use that value won't update if an intermediate parent returns...
Read more >
react-dom | Yarn - Package Manager
React will automatically unmount and remount every component, whenever a component mounts for the first time, restoring the previous state on the second...
Read more >
Handle 'componentWillReceiveProps' deprecation warning
As part of the implementation of async rendering in React, there are a few lifecycle methods which wi... Tagged with javascript, react, ...
Read more >
Returning null from setState in React 16 - LogRocket Blog
React 16 lets you decide whether state gets updated via .setState to prevent unnecessary DOM updates. Calling .setState with null no longer ...
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