2016-05-16 39 views
2

我有一个导航仪,显示仪表板在反应母语我想这样做poptoTop

<Navigator 
    ref="nav" 
    navigationBarHidden={true} 
    style={styles.container} 
    initialRoute={{name: 'dashboard'}} 
    renderScene={this.renderScene} 
    configureScene={() => { returnNavigator.SceneConfigs.PushFromRight; }} 
/> 

我能够递增和递减一篮计数器这个网页上购买产品后执行的组件的方法,我已经完成了购买产品后,我用

this.props.navigator.popToTop() 

回去,可惜柜台仍然是相同的,我怎么能叫在表盘的方法,当我回到它重置在篮下反或者我怎么能再次调用componentDidMount?

回答

0

您需要使用另一个lifecycle method,例如componentWillReceivePropscomponentWillUpdate。如果这可以修复你的错误很难说,因为你没有提供足够的代码来理解你的应用程序正在发生什么。