版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010377383/article/details/80720145
前言
使用React-Navigation出现以下问题:
Warning: isMounted(…) is deprecated in plain Javascript Classes. Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.
参考这是issu
我的依赖版本
"dependencies": {
"prop-types": "^15.6.1",
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.3.1",
"styled-components": "^3.3.2"
},
// 解决方案,在index.js增加如下代码
我将此代码添加到index.js,以便我可以忽略此警告。
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated', 'Module RCTImageLoader']);