2015-04-06 84 views
0

这里是我的看法切换页面为什么我改变导航器道具执行两次处理程序?

this.props.navigator.push({ 
    component: QuestionDetail, 
    passProps: { 
    id: id, 
    enteredDetail: function() { 
     console.log(this) 
    } 
    } 
}); 

// in QuestionDetail 
render: function() { 
    this.props.enteredDetail(); 
.... 

在Xcode中我看到这个

RCTJSLog> {"navigator":{},"route":{"passProps":{"id":"1010000002652090"}},"id":"1010000002652090"} 
RCTJSLog> {"navigator":{},"route":{"passProps":{"id":"1010000002652090"}},"id":"1010000002652090"} 

它出现了两次!为什么?

回答

相关问题