React Native Router

Simple, minimal routing for React Native

View the Project on GitHub

Simple React Native Routing

WARNING: react-native-router-flux v4 is in beta. Go here for v3.


Define all your routes in one place…

class App extends React.Component {
  render() {
    return (
      <Router>
        <Scene key="root">
          <Scene key="login" component={Login} title="Login"/>
          <Scene key="register" component={Register} title="Register"/>
          <Scene key="home" component={Home}/>
        </Scene>
      </Router>
    );
  }
}

…and navigate from scene to scene with a simple, 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'})

Try the example app

rnrf

# Get the code
git clone git@github.com:aksonov/react-native-router-flux.git`
cd react-native-router-flux/Example

# Install dependencies
yarn

# Run it
react-native run-ios

v4 Features

Breaking changes (compared to v3):

Migrating from v3

Coming soon