SHARE
TWEET

NavigationService

a guest Oct 16th, 2019 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { NavigationActions } from 'react-navigation';
  2.  
  3. let _navigator;
  4.  
  5. function setTopLevelNavigator(navigatorRef) {
  6.   _navigator = navigatorRef;
  7. }
  8.  
  9. function navigate(routeName, params) {
  10.   _navigator.dispatch(
  11.     NavigationActions.navigate({
  12.       routeName,
  13.       params,
  14.     })
  15.   );
  16. }
  17.  
  18. // add other navigation functions that you need and export them
  19.  
  20. export default {
  21.   navigate,
  22.   setTopLevelNavigator,
  23. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top