React Native Navigator 引入的那些坑
来源:互联网 发布:日本军国主义知乎 编辑:程序博客网 时间:2024/05/23 01:05
讲诉一下进入Navigator的那些错误。
当要引入Navigator的使用通常的做法是:
import {Navigator} from "react-native"
当我们进行执行react native 程序的时候 告知我们 该组件已经不存在 :
'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'
此时我们将要做的便是通过引用:
react-native-deprecated-custom-components 来导入 Navigator 组件
步骤如下:
1、打开程序的根目录(也就是和 Package.json 同级的目录)
2、使用cmd 命令工具 或者 Git Bash Here (前提是安装过GIT工具)
输入命令: npm install react-native-deprecated-custom-components --save
(下载并保存,此时package.json 文件 中 便会增加一条对该库的引用代表成功)
3、在使用Navigator的地方引用便可使用。
引用方式:import {Navigator} from "react-native-deprecated-custom-components"
注意:在引用时 一定在导入 Navigator的时候加上 {} 要不然会报错。
同时:当我在使用 npm install react-native-deprecated-custom-components --save 时报错
解决方法:
使用命令: npm i react-native-deprecated-custom-components --save
如果此方法还不能解决。
解决方法:
使用yarn命令(前提是自己有yarn的配置环境)
使用命令:yarn add react-native-deprecated-custom-components --save
最终解决Navigator的下载。
- React Native Navigator 引入的那些坑
- react native Navigator使用踩的坑
- React Native的Navigator详解
- React-Native -- 可继承的Navigator
- React Native的Navigator详解
- React Native的Navigator详解
- React Native的Navigator详解
- react native navigator 的使用
- react-native Navigator 填坑
- React-Native的那些坑
- React Native Android Navigator的使用
- React Native 的 Navigator 组件使用方式
- React Native 的 Navigator 组件使用方式
- react-native的跳转功能Navigator
- React Native 的 Navigator 组件(导航功能)
- react-native navigator
- react-native--Navigator
- React Native之Navigator
- [leetcode] Add to List 169. Majority Element
- 震撼发布2017年Android百大框架排行榜
- 最长公共连续子串
- shell中关于数字变量比较报错的问题
- C++中string erase函数的用法
- React Native Navigator 引入的那些坑
- 九宫格抽奖
- Q1:控制台输出helloworld
- Day 23 内置、匿名函数及递归
- sort函数用重载运算符出错
- 使用Jvisualvm监控线程死锁案例分析
- 在windows中安装两个MySQL
- 当spa单页面应用遇上SEO,蛋痛的经历
- [算法课模拟题]1000.函数求值