React-Native-Navigation v1 passProps没有进入我的下一页

时间:2018-06-11 19:33:42

标签: react-native react-redux react-native-navigation wix-react-native-navigation

我正在使用:

"react-native-navigation": "^1.1.465",
"react-native": "0.55.4",
"redux": "^3.7.2",

这是我的调用代码(我确定device.id中有值)

this.props.navigator.push({screen:'device',passProps:{deviceId:device.id}});

我也试过这个

 this.props.navigator.push({screen:'device',deviceId:device.id});

当我到达'{1}} ...在'device'组件中时,我的对象结构如下所示mapstatetoprops(state,ownProps) 同样在我的组件构造函数中,我放置了一个断点并看到了如上所述的相同对象。我正在使用

index.js:

{device:null}

registerScreens.js:

registerScreens(store, Provider); // this is where you register all of your app's screens
Navigation.startTabBasedApp({
  tabs: [
    {
      label: 'Home',
      screen: homeScreen, // this is a registered name for a screen
      icon: require('./assets/img/epilog_icon2.png'),
      selectedIcon: require('./assets/img/epilog_icon2.png'),
      title: 'Home'
    },
    {
      label: 'Settings',
      screen: 'settings',
      icon: require('./assets/img/hamberber512.png'),
      selectedIcon: require('./assets/img/hamberber512.png'),
      title: 'settings'
    }
  ],
  appStyle:{
    forceTitlesDisplay: true
  }
});

0 个答案:

没有答案