navigator-relay

0.1.1 • Public • Published

Installation

As usual:

$ npm i navigator-relay --save

Then include it in your code:

import {NavigatorRelay, makeNavState, navigationReducer} from 'navigator-relay';

And finally, use it to make your navigation to work:

const store = createStore(
  navigationReducer,
  makeNavState([<SomeInitialView/>])
);
 
AppRegistry.registerComponent('Basic', () => () => (
  <Provider store={store}>
    <NavigatorRedux />
  </Provider>
));

Note: This implementation use redux for managing a navigation stack.

API

Each view in the stack, while rendered, will receive a nav property with index, stack and actions.

  • index {Number}. Used to track your navigation stack position
  • stack {Immutable.Stack}. Your navigation stack
  • actions {Object}:
    • push(route). Push a new navigation state
    • pop(). Jump back to the previous navigation state
    • replace(route). Replace a current navigation state route by a given one

For further reading, check an example.

Status

  • Simple navigation
  • Animated transitions

Readme

Keywords

none

Package Sidebar

Install

npm i navigator-relay

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • kureev