hoyong

导航

React Native问题: componentWillReceiveProps is deprecated

Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.

 

处理:

 From https://stackoverflow.com/questions/49258598/react-native-lifecycle-methods-warning-componentwillreceiveprops-is-deprecate
 

I think it does not affect your application, it's just annoying.

Hide it by add below into index.js:

import { YellowBox } from 'react-native';

YellowBox.ignoreWarnings([
  'Warning: componentWillMount is deprecated',
  'Warning: componentWillReceiveProps is deprecated',
  'Module RCTImageLoader requires',
]);

posted on 2019-08-01 22:19  hoyong  阅读(264)  评论(0)    收藏  举报