Rocket.Chat.ReactNative/app/lib/Navigation.js

29 lines
411 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;
}
function back() {
_navigator.dispatch(
NavigationActions.back()
);
}
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 {
back,
2019-03-12 16:23:06 +00:00
navigate,
setTopLevelNavigator
};