Skip to content

qwlong/react-native-dva-starter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ee8bd65 Β· Sep 19, 2019

History

41 Commits
Mar 16, 2017
Sep 19, 2019
Jun 23, 2018
Sep 19, 2019
Mar 16, 2017
Jun 17, 2017
Jun 23, 2018
Sep 19, 2019
Mar 16, 2017
Jun 23, 2018
Mar 16, 2017
Jun 24, 2018
Aug 10, 2017
Sep 19, 2019
Jun 23, 2018
Mar 22, 2017
Sep 19, 2019
Sep 19, 2019
Sep 19, 2019

Repository files navigation

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 react-navigation/react-navigation#232, so I use two StackNavigators to contain the screens with different transition animations, you can create you own transition animations via transitionConfig, see react-navigation/react-navigation#99

LICENSE

MIT

About

a React Native starter powered by dva and react-navigation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 64.0%
  • Objective-C 19.5%
  • Python 9.8%
  • Java 6.7%