Navigator deprecated
来源:6-8 RN 导航器 Navigator 的用法
西贝汪
2017-11-25
我看了下您V42.3版本里使用的是react navigation,而只有在./app/containers/index.js里面有用navigator,而且index.js这个文件好像没有用到
那我是不是可以不用navigator,直接学react navigation
2回答
-
是的,可以的
012017-11-26 -
慕函数7881054
2017-11-27
首先安装RN已经删除的的组件
npm install react-native-deprecated-custom-components –save
然后从这个包中引入
import {Navigator} from ‘react-native-deprecated-custom-components';
然后会报这个错
Cannot read property 'shape' of undefined
github解决办法是:
You have to change few things in the Library :
PropTypes is deprecated from React , you have to use a separate library (npm install --save prop-types) and then you import it in the file NavigatorBreadcrumbNavigationBar (import PropTypes from 'prop-types';) and remove the PropTypes import from React.翻译一下就是 Navigator 依赖了PropTypes 这个包
那就 npm install --save prop-types
然后再将这个包引入 则需要将用到这包的地方 NavigatorBreadcrumbNavigationBar 都替换了
真的好折腾 弄了半个小时
00
相似问题