You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
348 B
22 lines
348 B
6 years ago
|
import { NavigationActions } from 'react-navigation';
|
||
|
|
||
|
let _navigator;
|
||
|
|
||
|
function setTopLevelNavigator(navigatorRef) {
|
||
|
_navigator = navigatorRef;
|
||
|
}
|
||
|
|
||
|
function navigate(routeName, params) {
|
||
|
_navigator.dispatch(
|
||
|
NavigationActions.navigate({
|
||
|
routeName,
|
||
|
params,
|
||
|
}),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default {
|
||
|
navigate,
|
||
|
setTopLevelNavigator,
|
||
|
};
|