今天,我处理错误情况,当多次返回错误时,未调用组件getDerivedStateFromProps,但reducer处于返回状态。是什么原因?
//here is the reducer error code, I use the console.log("the reducer"), find here return
//data
case ERROR:
{
console.log("the error state reducer returns")
return {
...state,
isSuccess:false,
error:"load data info"
};
}
break;