// 路由栈
const Navigator = StackNavigator({
Setting: {screen: SettingSCreenView},
....
});
1、设置路由状态改变拦截
function getCurrentRouteName(navigationState) {
if (!navigationState) {
return null;
}
const route = navigationState.routes[navigationState.index];
// dive into nested navigators
if (route.routes) {
return getCurrentRouteName(route);
}