Error: Reducer “good” returned undefined during initialization
Error: Reducer "good" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.
原因:定义reducer时,设置的匹配失败时的返回state的值有问题
解决方案:
这是之前的代码:
export default function goodReducer(state, action) {
版权声明:本文为little110原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。