美文网首页react-native
ReactNative跳转到指定页面

ReactNative跳转到指定页面

作者: Erica0708 | 来源:发表于2017-05-09 17:24 被阅读0次

ReactNative像APP一样返回到指定页面

//得到Navigator的层级关系
var currentRoute = this.props.navigator.getCurrentRoutes();

for(var i = 0; i < currentRoute.length; i++){
  if(currentRoute[i].name  === '你想跳转的页面'){
      this.props.navigator.popToRoute(currentRoute[i]);
  }
}

相关文章

网友评论

    本文标题:ReactNative跳转到指定页面

    本文链接:https://www.haomeiwen.com/subject/bfritxtx.html