Define all your routes in one React component...
const App =<Router><Stack key="root"><Scene key="login" component=Login title="Login"/><Scene key="register" component=Register title="Register"/><Scene key="home" component=Home/></Stack></Router>;
...and navigate from scene to scene with a simple, powerful API
// Login.js// navigate to 'home' as defined in your top-level routerActions// go back (i.e. pop the current screen off the nav stack)Actions// refresh the current Scene with the specified propsActions
# Get the codegit clone https://github.com/aksonov/react-native-router-flux.gitcd react-native-router-flux/Example# Install dependenciesyarn# Run itreact-native run-ios
componentdefined can have
onhandler can be async.
successhandler (if defined) will be executed
successis a string then router will navigate to the
Scenewith that key
failureprop (if defined) will be run.
failuremakes patterns like authentication, data validation, and conditional transitions simple and intuitive.
observer. You may subscribe to
Actionsin v3) and observe current navigation state. Not applicable to Redux.
rightTitleto a scene will apply to all child scenes. See example app.
Actions.currentSceneto get name of current scene.
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]