2016-10-31 16 views

回答

0

我認爲你可以實施componentWillReceiveProps方法,並檢查當前道具是否與nextProps不同,並在新道具收到時更新。

componentWillReceiveProps(nextProps){ 
    if(this.props.propsName !== nextProps.propsName){ 
     // do your update logic here 
    } 
} 
相關問題