[英]Expo SDK 36, a generic resolution for "componentWillReceiveProps has been renamed, and is not recommended for use" errors
When I run expo start
the warning I receive is:当我运行
expo start
,收到的警告是:
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.我没有使用
componentWillReceiveProps
但依赖expo
正在使用。
npx react-codemod rename-unsafe-lifecycles
checks only the codes that I wrote, not the ones coming from node_modules
.npx react-codemod rename-unsafe-lifecycles
只检查我写的代码,而不是来自node_modules
。Please update the following components: SafeView, Transitioner
is 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.Please update the following components: SafeView, Transitioner
不适用,因为它们不是来自我包含的组件,而是来自expo
及其依赖项,其中主要是react-native
本身。 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 (ie react-native-safe-area-view react-navigation react-navigation-stack packages) ?否则,是否有一种方法可以摆脱
SafeView
和Transitioner
组件(即 react-native-safe-area-view react-navigation react-navigation-stack 包)?
Seems being (as of March 2nd, 2020) addressed within SDK 38.似乎(截至 2020 年 3 月 2 日)已在 SDK 38 中解决。
Pls refer to:请参考:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.