Navigation is build upon react-navigation. Consider reading their documentation for further details.
Navigator
The navigator enables usage of navigation actions outside of the page scope.
To get it to work you will have to pass the most outer navigation component (root navigator) to it like:
import { Navigator } from '@dormakaba/digital-reactnative-client';
// router provides any of SwitchNavigator, StackNavigator, ...
import Router from './Router';
<Router
ref={navigatorRef => {
Navigator.setContainer(navigatorRef);
}}
/>
Now you can use any navigation function of:
// get current route
Navigator.getCurrentRoute();
// get current route name
Navigator.getCurrentRouteName();
// navigate
Navigator.navigate(routeName, params);
Navigator.navigateDeep([{ routeName, params }, { routeName, params }]);
Navigator.back()
Navigator.reset(routeName, params);
Drawer Component
To be used as contentComponent of a DrawerNavigator