4

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) ?

Mehmet Kaplan
  • 1,723
  • 2
  • 20
  • 43
  • I'm not sure its possible to disable the error completely, however its is actually a warning and this warning won't show up in the production build. – Danny Feb 16 '20 at 14:12
  • Thanks Danny. That I already know. But still I wanna get rid of it proper way. – Mehmet Kaplan Feb 16 '20 at 14:13
  • there is an open issue on react native https://github.com/facebook/react-native/issues/22186 perhaps this is related. – Danny Feb 16 '20 at 14:22

1 Answers1

0

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
Mehmet Kaplan
  • 1,723
  • 2
  • 20
  • 43