verdnatura-chat/app/lib/Navigation.js

22 lines
330 B
JavaScript
Raw Normal View History

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