Describe the bug
In reference to aws-amplify-react-native/src/Auth/ConfirmSignUp.js
This react component still implements componentWillReceiveProps whereas this has been deprecated since React 16.3. This class should be updated to use getDerivedStateFromProps. This probably applies to all the Auth components.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The username field should be pre-filled, because the user just signed up on the previous screen.
Actual behavior
The field is blank.
Smartphone:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
_React Native + TypeScript + Jest_
I got a warning:
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.
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-lifecyclesin your project source folder.Please update the following components: ConfirmSignUp
+1 React Native 0.61.4
"react-native": "0.61.2",, slightly different use case. The following warning is logging in metro bundler,
WARN Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks 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: ConfirmSignUp
+1 Using expo
how do we fix this? I am getting it also.
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
Please update the following components: ConfirmSignUp
expo-cli: 3.11.1
"expo": "^36.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
"aws-amplify": "^2.2.1",
"aws-amplify-react-native": "^2.2.3",
I am getting the same warning.
Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
npx react-codemod rename-unsafe-lifecycles in your project source folder.Please update the following components: ConfirmSignUp
I have the exact same issue as well when using Authenticator from aws-amplify-react-native without Expo. Here is my package.json:
"dependencies": {
"amazon-cognito-identity-js": "^3.2.2",
"aws-amplify": "^2.2.2",
"aws-amplify-react-native": "^3.2.0",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-gesture-handler": "^1.5.3",
"react-native-reanimated": "^1.7.0",
"react-native-screens": "^2.0.0-alpha.32",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^4.1.0",
"react-navigation-tabs": "^2.7.0"
},
Most helpful comment
_React Native + TypeScript + Jest_
I got a warning: