react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

fix: replaces UNSAFE_componentWillReceiveProps with componentDidUpdate

Open GuillaumeOj opened this issue 6 months ago • 1 comments

The use of UNSAFE_componentWillReceiveProps is throwing an error with new versions of react-native.

 ERROR  Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/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://react.dev/link/derived-state

Here is a PR with a fix based on the recommendations in the error message to solve it. I'm not 100% confident on this fix (I'm a beginner in the react ecosystem), so feel free to give me some suggestions.

GuillaumeOj avatar May 20 '25 08:05 GuillaumeOj

Please merge this

Cheizr avatar Oct 09 '25 15:10 Cheizr