報錯如下:
Navigator is deprecated and has been removed from this package. It can now be installed and imported from `react-native-deprecated-custom-components` instead of `react-native`. Learn about alternative navigation solutions at http://facebook.github.io/react-native/docs/navigation.html'
看報錯信息應該是RN版本升級把Navigator移除了,我現在版本是0.57.0。
要使用Navigator應該先安裝:
npm install react-native-deprecated-custom-components --save
然後在要用的地方導入,即可使用Navigator。
import {Navigator} from 'react-native-deprecated-custom-components';