1.通过给子组件加不同的key
<Son key = { Math.random() } />
2.改变父组件给子组件的Props,然后子组件里面调用
componentWillReceiveProps (currentPoprs, nextProps) {
this.setState ( {
// update your state
})
}
1.通过给子组件加不同的key
<Son key = { Math.random() } />
2.改变父组件给子组件的Props,然后子组件里面调用
componentWillReceiveProps (currentPoprs, nextProps) {
this.setState ( {
// update your state
})
}