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

Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code.

Open dmahajan980 opened this issue 2 years ago • 6 comments

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

dmahajan980 avatar Feb 01 '22 06:02 dmahajan980

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.

github-actions[bot] avatar Feb 01 '22 06:02 github-actions[bot]

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?

github-actions[bot] avatar Feb 01 '22 06:02 github-actions[bot]

Hey @dmahajan980, Can you provide minimal code example where this warning occurs (Snack, repository, code snippet)?

kkafar avatar Feb 01 '22 12:02 kkafar

I got the same issue. It seems to happen when using the <React.StrictMode> since i removed i stopped seeing this warning

nassif7 avatar Jun 30 '22 06:06 nassif7

Same here. As @nassif7 said, the issue started appearing when wrapping my app in <React.StrictMode>

AdamTyler avatar Jul 11 '22 18:07 AdamTyler

Same here.

rumbogs avatar Jul 18 '22 13:07 rumbogs

same here. All up to date to expo 48 etc. Steps to reproduce:

  1. wrap your app in a <React.StrictMode></React.StrictMode>

michakfromparis avatar Feb 27 '23 21:02 michakfromparis

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.

longphung avatar Apr 06 '23 06:04 longphung