react-native DrawerNavigator与StackNavigator混搭 this.props.navigation.goBack()不好用 可增加Navigation Actions混搭

未结帖
0 576
ajian admin_jim 2017-12-26
悬赏:5飞吻
import {NavigationActions} from 'react-navigation';


back() {
    //this.props.navigation.goBack();
    // const {dispatch} = this.props.navigation;
    // const resetAction = NavigationActions.reset({
    //     index: 0,
    //     actions: [
    //         NavigationActions.navigate({routeName: 'Main'}),
    //     ]
    // });
    // dispatch(resetAction);
    console.log(this.props);
    const backAction = NavigationActions.back({
        key: null
    })
    this.props.navigation.dispatch(backAction)

}


热忱回答0


最近热帖

近期热议

  1. javascript——prototype与__proto 9
  2. Mysql 中出现的Data truncated for column 3
  3. 在nginx中使用x-sendfile的解决方案 3
  4. 高版本jQuery面插件实现Ajax上传图片 1
  5. Thinkphp Socket.class.php 类的使用 1
  6. 使用ionic3创建第一个App 0
  7. ios-oc html5 0
  8. nginx.conf 0
  9. 基于ionic3.4.0的项目搭建 0
  10. php 缩略图 0