TopGit tracks aksonov/react-native-router-flux on GitHub. The project has 8.9k stars. The first declarative React Native router
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
react-native-router-flux is a different API over react-navigation. It helps users to define all the routes in one central place and navigate and communicate between different screens in an easy way. But it also means that react-native-router-flux inherits all limitations and changes from updated versions.
IMPORTANT NOTES
v5.0.alpha.x is based on React Navigation v5.x (very early alpha, development in progress, help wanted!)
v4.2.x is based on React Navigation v4.x
v4.1.0-beta.x is based on React Navigation v3.x
v4.0.x is based on [React Navigation v2.x]. See this branch and docs for v3 based on deprecated React Native Experimental Navigation API. It is not supported and may not work with latest React Native versions.
v4.0.0-beta.x is based on React Navigation v1.5.x. See this branch for this version. It is also not supported and may not work with the latest React Native versions.
Examples
Motivation
v4 Features
API
Migrating from v3
Sponsors/Backers/Contributors
Getting Started
Install native dependencies used by RNRF (see below, https://reactnavigation.org/docs/en/getting-started.html)
Install this component
yarn add react-native-router-flux
install the following libraries first
react-native-screens by ( npm install react-native-screens || yarn add react-native-screens)
...and navigate from one scene to another scene with a simple and powerful API.
// Login.js
// navigate to 'home' as defined in your top-level router
Actions.home(PARAMS);
// go back (i.e. pop the current screen off the nav stack)
Actions.pop();
// refresh the current Scene with the specified props
Actions.refresh({ param1: 'hello', param2: 'world' });
API
For a full listing of the API, view the API docs.
Try the example apps
# Get the code
git clone https://github.com/aksonov/react-native-router-flux.git
cd react-native-router-flux/examples/[expo|react-native|redux]
# Installing dependencies
yarn
# Run it
yarn start
v4 Features
Based on latest React Navigation API
Separate navigation logic from presentation. You may now change navigation state directly from your business logic code - stores/reducers/etc. navigationStore
Built-in state machine (v3 Switch replacement)
Each Scene with component defined can have onEnter/onExit/on handlers.
onEnter/on handler can be async.
For 'truthy' return of onEnter/on, success handler (if defined) will be executed
if success is a string then router will navigate to the Scene with that key
in case of handler's failure, failure prop (if defined) will be run.
Combining onEnter, onExit, success, and failure makes patterns like authentication, data validation, and conditional transitions simple and intuitive.
MobX-friendly: all scenes are wrapped with observer. You may subscribe to navigationStore (Actions in v3) and observe current navigation state. Not applicable to Redux.
Flexible Nav bar customization, currently not allowed by React Navigation:
https://github.com/react-community/react-navigation/issues/779
Drawer support (provided by React Navigation)
Inheritance of scene attributes allow you to avoid any code/attribute duplications. Adding rightTitle to a scene will apply to all child scenes simultaneously. See example app.
Access to your app navigations state as simple as Actions.state.
Use Actions.currentScene to get name of current scene.
Helpful tips if you run into some gotchas
Using Static on Methods with HOCs
This is just a helpful tip for anyone who use the onExit/onEnter methods as a static method in their Component Class. Please refer to this link https://reactjs.org/docs/higher-order-components.html.
If your Scene Components are Wrapped in Custom HOCs/ Decorators, then the static onExit/onEnter methods will not work as your Custom HOCs will not copy the static methods over to your Enhanced Component.Use the npm package called hoist-non-react-statics to copy your Component level static methods over to your Enhanced Component.
Implement onBack from your Scene after declaring it
If you have a Scene where in you want to make some changes to your Component State when Back button is pressed, then doing this
Does aksonov/react-native-router-flux have any tags?
TopGit's last sync did not record any GitHub topics for aksonov/react-native-router-flux. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on aksonov/react-native-router-flux?
The most recent commit recorded on aksonov/react-native-router-flux was 3.2 years ago, based on the GitHub push timestamp. The repository has 2.1k forks — one of the better signals of community interest.
How many stars does aksonov/react-native-router-flux have?
aksonov/react-native-router-flux has 8.9k GitHub stars — refresh the page for the live number, or check github.com/aksonov/react-native-router-flux. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is aksonov/react-native-router-flux written in?
aksonov/react-native-router-flux is written primarily in JavaScript. GitHub's language field is based on the largest share of bytes in the default branch.
Where do I read more about aksonov/react-native-router-flux?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/aksonov/react-native-router-flux is the definitive source.
Read full README in the tab above.
Curious whether react-native-router-flux is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about react-native-router-flux.