react-native-dva-starter

a React Native starter powered by dva and react-navigation

Github星跟踪图

react-native-dva-starter

A React Native starter powered by dva and react-navigation

Start

npm install dva-native-cli -g
dvanative git app
cd app
react-native run-ios # or react-native run-android

Great thanks to @xuan45 for his cli tool dva-native-cli, check that project for more information.

Advance

The builtin router of dva (not react-router v4), doesn't support React Native, we have to integrate other router components, such as Navigator, ExperimentalNavigation, react-native-router-flux and react-navigation. Since the former two will be depreciated in flavor of react-navigation, which is also be recommended by official, so I choose it to be the navigator.

In this starter, I provide a router model to control the default action flow of react-navigation to workaround a known issue. If you don't need this, the integration will be much simpler, you can simply remove the router model and pass routerReducer to extraReducer of dva extraReducers: { router: routerReducer }. Read Redux Integration and dva's API for more information.

Also there is another workaround for a missing feature https://github.com/react-community/react-navigation/issues/232, so I use two StackNavigators to contain the screens with different transition animations, you can create you own transition animations via transitionConfig, see https://github.com/react-community/react-navigation/pull/99

LICENSE

MIT

主要指标

概览
名称与所有者nihgwu/react-native-dva-starter
主编程语言JavaScript
编程语言JavaScript (语言数: 4)
平台
许可证
所有者活动
创建于2017-03-16 05:59:57
推送于2022-12-07 09:47:41
最后一次提交2019-02-07 23:55:33
发布数0
用户参与
星数641
关注者数32
派生数144
提交数34
已启用问题?
问题数75
打开的问题数11
拉请求数3
打开的拉请求数16
关闭的拉请求数8
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?