react-native-router-flux是啥
其實就相當于路由,而且是基于官方的react-navigation搭建的
首先我們先安裝
npm install react-native-router-flux --save-dev
在頁面中引入
import {Router, Scene} from "react-native-router-flux";
我們在頁面中創建一個登錄頁面和注冊頁面
image.png
注冊和登陸頁面都先像這樣簡單的寫一下
然后就和router一樣在下面寫
image.png
那么如何進行頁面跳轉呢
首先我們要引入Actions
import {Actions} from "react-native-router-flux";
然后指定要跳轉的頁面
Actions.register();
這里定義的register其實也就是你在router里面寫的key
image.png
react-native整合系列(一)——集成redux
http://www.lxweimin.com/p/d207db8e2d0b
react-native整合系列(二)——集成Ant Design Mobile RN
http://www.lxweimin.com/p/f8b6a07e108f