When I run expo start the warning I receive is:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. 
...

* 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: SafeView, Transitioner
- node_modules/expo/build/environment/muteWarnings.fx.js:18:23 in warn
...

I know this is a warning and is not seen in production mode, but in order not to miss other possible warnings I want to get rid of this.

I am not using componentWillReceiveProps but the dependencies expo has are using.

  • The suggested npx react-codemod rename-unsafe-lifecycles checks only the codes that I wrote, not the ones coming from node_modules.
  • And the suggestion Please update the following components: SafeView, Transitioneris not applicable because they are not from the components that I included but from expo and its dependencies where the major one is the react-native itself.

As a solution is there any method to get rid of this warning in a generic way? Else, is there a method to get rid for only SafeView and Transitioner components (i.e. react-native-safe-area-view react-navigation react-navigation-stack packages) ?

1

There are 1 best solutions below

0
On

Seems being (as of March 2nd, 2020) addressed within SDK 38.

Pls refer to:

  1. https://github.com/expo/expo/issues/5763
  2. https://github.com/expo/expo/pull/7227
  3. https://github.com/orgs/expo/projects/6