react-native-navigation:返回上一屏幕

时间:2018-07-13 07:24:26

标签: react-native react-navigation react-native-navigation react-native-navigation-v2

我正在使用以下代码进行导航

import { NavigationActions } from 'react-navigation';

let _navigator;

const setTopLevelNavigator = (navigatorRef) => {
_navigator = navigatorRef;
}

const navigate = (routeName, params) => {
_navigator.dispatch(
NavigationActions.navigate({
  routeName,
  params   
})
);
}

export default {
  navigate,
  setTopLevelNavigator,
};

之后,我只是在做

NavigationService.navigate('<ScreenName>');

问题-转到下一个屏幕,但不返回上一个屏幕

0 个答案:

没有答案