Navigator deprecated

来源:6-8 RN 导航器 Navigator 的用法

西贝汪

2017-11-25

http://img.mukewang.com/szimg/5a1896c40001285a08941738.jpg

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

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

写回答

2回答

Scott

2017-11-25

是的,可以的

0
1
西贝汪
非常感谢!
2017-11-26
共1条回复

慕函数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 都替换了

真的好折腾 弄了半个小时


0
0

贯穿全栈React Native开发App

全面掌握React Native技术,不止步前端开发,让你移动领域大放光彩

946 学习 · 385 问题

查看课程