【问题标题】:React Native - load content using "Navigation Experimental"React Native - 使用“导航实验”加载内容
【发布时间】:2016-10-01 17:32:02
【问题描述】:

我用 React Native 教程做了一个导航实验,它正在工作! (故意)

我的问题是:我无法加载下一个场景的“内容”...(只有导航器改变)

if (this.state.navigationState.index == 0) {
    const route = {key: 'secondepage', component:MyScene};
    console.log("après modification "+route.component.defaultProps.title);

    // Use the push reducer provided by NavigationStateUtils
    navigationState = NavigationStateUtils.push(navigationState, route);
}

问题是我无法加载组件“我的场景”... 我看到我可以获得组件 Myscene (route.component.defaultProps.title) 的道具,但它不会在里面加载 Text。 NavigationStateUtils.push(..,..) 工作了吗?

注意:如果你想要完整的代码,我可以粘贴它。谢谢你的回答

【问题讨论】:

    标签: routes react-native reactive-programming navigator


    【解决方案1】:

    我找到了解决方案...它工作正常,只是我没有更改我的函数 RendersScene...

    (我添加了“switch(this.props.index)”:所以我可以使用索引值(〜这是我的页面编号)更改渲染)

    【讨论】:

      猜你喜欢
      • 2016-08-14
      • 1970-01-01
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 2022-12-24
      • 1970-01-01
      • 1970-01-01
      • 2016-08-14
      相关资源
      最近更新 更多