react-animated-css icon indicating copy to clipboard operation
react-animated-css copied to clipboard

Warning: componentWillReceiveProps has been renamed, and is not recommended for use ... Please update the following components: Animated

Open marcolino opened this issue 6 years ago • 2 comments

When using [email protected] (with react 16.10.2), I get this warning:

backend.js:6 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-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://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: Animated

If I drop react-animated-css from my project, the warning disappears.

What do you suggest me to do?

marcolino avatar Nov 22 '19 17:11 marcolino

You are getting the warning because that lifecycle method is gonna be deprecated soon in the React framework. So you can use it for now just take notice of the react's change log before updating. I guess some cool contributor will submit a PR before that happens.

enqqi avatar Nov 29 '19 06:11 enqqi

I tried solving the issue and created a pull request #30 . I don't know how to test it as a dist lib. Let's see if dev accepts or rectifies solution and merges.

rachit995 avatar Feb 04 '20 11:02 rachit995