2019-10-19 00:07:34 +03:00
|
|
|
import { NavigationActions } from 'react-navigation';
|
|
|
|
|
|
|
|
let _navigator;
|
|
|
|
|
2019-10-29 16:16:44 +03:00
|
|
|
const setTopLevelNavigator = navigatorRef => {
|
2019-10-19 00:07:34 +03:00
|
|
|
_navigator = navigatorRef;
|
|
|
|
};
|
|
|
|
|
2019-10-29 16:16:44 +03:00
|
|
|
const navigate = navigationProps => {
|
2019-10-19 00:07:34 +03:00
|
|
|
_navigator.dispatch(
|
|
|
|
NavigationActions.navigate({
|
2019-10-29 16:16:44 +03:00
|
|
|
...navigationProps,
|
2019-10-19 00:07:34 +03:00
|
|
|
}),
|
|
|
|
);
|
|
|
|
};
|
2019-10-29 16:16:44 +03:00
|
|
|
|
|
|
|
// add other navigation functions that you need and export them
|
|
|
|
|
|
|
|
export default {
|
|
|
|
navigate,
|
|
|
|
setTopLevelNavigator,
|
|
|
|
};
|