react-native-navigation-actions
This library offer nice abstractions and flexibility around react-navigation.
Installation
If you use yarn:
yarn add react-native-navigation-actions
If you use npm:
npm install --save react-native-navigation-actions
Construct a AppNavigator object passing you main Navigator (root).
;; const Stack = const AppNav = /*...*/ ;AppRegistry;
Usage
react-native-navigation-actions provides Actions
that's dispatch NavigationActions in a simple call, and a navigatorRef
just because it might be needed at some point.
; // At any point you can call:ActionsActions
API functions:
Same API as https://reactnavigation.org/docs/navigation-actions.html:
- back
- reset
- setParams
- init
- reset
- replace
- push
- poppopToTop