react-native-reanimated
react-native-reanimated copied to clipboard
Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code.
Description
I am receiving the following warning when using Animated.View
:
Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.
* Move code with side effects to componentDidMount, and set initial state in the constructor.
Please update the following components: AnimatedComponent
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: AnimatedComponent
Package versions
name | version |
---|---|
react-native | ^0.64.3 |
react-native-reanimated | ~2.3.1 |
NodeJS | 16.13.0 |
expo | ~44.0.0 |
Hey! 👋
It looks like you've omitted a few important sections from the issue template.
Please complete Snack or minimal code example and Affected platforms sections.
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?
Hey @dmahajan980, Can you provide minimal code example where this warning occurs (Snack, repository, code snippet)?
I got the same issue. It seems to happen when using the <React.StrictMode> since i removed i stopped seeing this warning
Same here. As @nassif7 said, the issue started appearing when wrapping my app in <React.StrictMode>
Same here.
same here. All up to date to expo 48 etc. Steps to reproduce:
- wrap your app in a <React.StrictMode></React.StrictMode>
I have created a minimal reproduction of the issue in a GitHub.
This is the project directly after running npx react-native@latest init
Here's the link: https://github.com/longphung/react-native-animated-strict-mode
All I did was wrap the App component in React.StrictMode
and the error apepars in the log.