navigator-relay
v0.1.1Installation
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