React Native Navigator組件回調

在push的時候定義回調函數:函數

this.props.navigator.push({
   component: nextVC,
   title: titleName,
   passProps: {
      
      //回調
      getUserInformation: function(inforDict) {
         alert(inforDict);
      }
   }
});

在push的界面調用
this.props.getUserInformation('回調');


注: 若是回調報錯,

  查看renderScene this

 renderScene={(route, navigator)=>{
    let Component = route.component;
    return<Component {...route.passProps} navigator = {navigator}/>;
 }}
相關文章
相關標籤/搜索