在react项目中报错:
error:The slice reducer for key "recommend" 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.
原因:switch中没有设置default解决方法:给switch添加default
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)