我正在尝试升级我的react版本,从react 15升级到16,所以在这样做的同时,在getDerivedStateFromProps中也面临着一个挑战。在ComponentWillReceiveProps中,componentWillReceiveProps(nextProps) {
}
// in the above am checking two differe
对我来说,componentWillReceiveProps和getDerivedStateFromProps到底是个微妙的问题。因为,我在使用getDerivedStateFromProps时遇到了一个问题:state = {}
})
// But using this method will cause