2019-03-12 16:23:06 +00:00
|
|
|
import { NavigationActions } from 'react-navigation';
|
2019-01-31 16:08:38 +00:00
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
let _navigator;
|
2019-01-31 16:08:38 +00:00
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
function setTopLevelNavigator(navigatorRef) {
|
|
|
|
_navigator = navigatorRef;
|
|
|
|
}
|
2019-01-31 16:08:38 +00:00
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
function navigate(routeName, params) {
|
|
|
|
_navigator.dispatch(
|
|
|
|
NavigationActions.navigate({
|
|
|
|
routeName,
|
|
|
|
params
|
|
|
|
})
|
|
|
|
);
|
2019-01-31 16:08:38 +00:00
|
|
|
}
|
|
|
|
|
2019-03-12 16:23:06 +00:00
|
|
|
export default {
|
|
|
|
navigate,
|
|
|
|
setTopLevelNavigator
|
|
|
|
};
|