请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Navigator deprecated

https://img1.sycdn.imooc.com//szimg/5a1896c40001285a08941738.jpg

我看了下您V42.3版本里使用的是react navigation,而只有在./app/containers/index.js里面有用navigator,而且index.js这个文件好像没有用到

那我是不是可以不用navigator,直接学react navigation

正在回答

2回答

是的,可以的

0 回复 有任何疑惑可以回复我~
  • 提问者 西贝汪 #1
    非常感谢!
    回复 有任何疑惑可以回复我~ 2017-11-26 05:04:52
慕函数7881054 2017-11-27 18:29:47

首先安装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 都替换了

真的好折腾 弄了半个小时


0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信