Skip to content

Conversation

GuillaumeOj
Copy link

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.

duration: duration || this.props.duration || 1000,
useNativeDriver,
delay: (iterationDelay && currentIteration > 0) ? iterationDelay : 0,
delay: iterationDelay && currentIteration > 0 ? iterationDelay : 0,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change made with yarn format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant