react-native-router-redux
Router component to be used in your React Native redux applications. Packed with Nav and TabBar support.
getting started
The easiest way to get started is to check out the example:
cd example/ReduxRouter/
npm install
react-native start
or install it into your React Native application:
npm install -S react-native-router-redux
Import and connect the router in your container:
// reducers/index.js; ; // hook up the reducers;const reducer = ; // import react-native-router-redux; // connect your state and actions (using react-redux)const mapStateToProps = router: staterouter; const mapDispatchToProps = actions: dispatch; // define your routesconst defaultSchema = navBar: NavBar navLeftColor: '#FFFFFF' navTint: '#224655' navTitleColor: '#FFFFFF' navTitleStyle: fontFamily: 'Avenir Next' fontSize: 18 statusStyle: 'light-content' tabBar: TabBar; { return <Router ...thisprops assets=assets initial="signIn"> <Schema name="default" ...defaultSchema /> <Route name="signIn" component=SignIn type="reset" hideNavBar=true /> <Route name="detail" component=Detail /> <TabRoute name="tabBar" barTint='#FFFFFF' tint="#32DEAF"> <Route name="tab1" component= title="Home" tabItem=icon: assets'home' title: 'Home' /> <Route name="tab2" component= title="Calendar" tabItem=icon: assets'calendar' title: 'Calendar' /> <Route name="tab3" component= title="Video" tabItem=icon: assets'video' title: 'Video' /> <Route name="tab4" component= title="Profile" tabItem=icon: assets'profile' title: 'Profile' /> </TabRoute> </Router> ; } mapStateToProps mapDispatchToPropsApplication;
inspiration
Thanks to aksonov/react-native-router-flux for providing the basis for this package.