https://github.com/ali322/rn-navigation
yet another router for react-native
https://github.com/ali322/rn-navigation
react-native redux
Last synced: 7 months ago
JSON representation
yet another router for react-native
- Host: GitHub
- URL: https://github.com/ali322/rn-navigation
- Owner: ali322
- Created: 2016-11-21T08:24:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-27T13:15:22.000Z (over 8 years ago)
- Last Synced: 2024-11-27T20:17:44.474Z (8 months ago)
- Topics: react-native, redux
- Language: JavaScript
- Homepage:
- Size: 598 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RN-Navigation [](https://circleci.com/gh/ali322/rn-navigation) [](https://badge.fury.io/js/rn-navigation)
===
[](https://nodei.co/npm/rn-navigation/)inspired by [react-native-router-flux](https://github.com/aksonov/react-native-router-flux),yet another router for react-native,built on new NavigationExperimental API,easy to migrate with redux and other flux-like framework
Install
===```javascript
npm install rn-navigation --save
```then you need link the dependenices
```javascript
react-native link react-native-vector-icons
```Useage
===in your entry point (etc: index.ios.js),define your own routes by Scene component,and wrap all of routes with Router component
```javascript
class Index extends React.Component{
render(){
const sceneProps = {
//scene props what you like to pass into scene components
}
return (
)
}
}
```then create your own redux store
```javascript
import {routerReducer} from "rn-navigation"const rootReducer = combineReducers({routerReducer})
connect(state=>({
navigationState:state.navigationState
}))(Index)
```
in scene component you can navigate to next,or go back to prev```javascript
this.props.navigationActions.pushScene("topic")
this.props.navigationActions.popScene()
```just simple and easy,more instructions refer to [API](./API.md),or [中文文档](./API_zh.md)
## Todo
- fix some unknow bugs
- add more api documents## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License)