admin管理员组文章数量:1530021
前言
使用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']);
本文标签: 环境warningReactNativeisMounted
版权声明:本文标题:React Native开发(一:环境相关,出现Warning: isMounted(...) is deprecated in plain Javascript Classes) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1726604470a1077411.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论