Navigator不能用问题

根据信息,react-native这个包中的Navigator已经被移除,而需要导入react-native-deprecated-custom-components这个包来使用Navigator。于是就需要安装这个包并引入。具体做法如下:

1. 通过npm安装相应的库

在项目根目录下输入npm i react-native-deprecated-custom-components –save 回车。

2. 在使用的JS文件中将Navigator引入进来,就是import

import {Navigator} from ‘react-native-deprecated-custom-components’;

然后就可以在项目中正确使用Navigator了。

你可能感兴趣的:(Navigator不能用问题)