0.49版本开发React Native 项目时,从react-native中导入Navigator时报如下图错误


  Navigator is deprecated and has been removed from this package

查找原因得知,因为react-native版本升级到0.43以上以后,Navigator不能直接从react-native中导入获取了

解决方法:

在命令行中npm install react-native-deprecated-custom-components,安装成功以后,把引用的地方改为import {Navigator} from react-native-deprecated-custom-components即可。

相关文章: