1.actions must be plain objects.Use custom middleware for async
![](https://img.haomeiwen.com/i5642548/e909296e14dc85c7.png)
原因:dispatch(action),action格式不对
例如:
![](https://img.haomeiwen.com/i5642548/dda4aea25d09d5ee.png)
改成:
![](https://img.haomeiwen.com/i5642548/7325489151597791.png)
2.Cannot convert undefined or null to object
![](https://img.haomeiwen.com/i5642548/e9d0065a6bf3ed64.png)
原因:渲染的时候用到的数据源为null或不存在
解决:数据源非真的时候不进行渲染!
shouldComponentUpdate(nextProps, nextState){
alert(123);
console.log(nextProps);
if(!nextProps.datasource){
return false;
}
return true;
}
网友评论