× Error: The slice reducer for key “auth“ returned undefined during initialization. If the state pas

Error: The slice reducer for key “auth” 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.

× Error: The slice reducer for key “auth“ returned undefined during initialization. If the state pas
原因: switch (action.type) 没有设置default

export default function authReducer(state, action) {
    switch (action.type) {
        case SIGNUP:
            return {
                ...state,
                signup: {
                    loaded: false,
                    success: false,
                }
            }
        default:
            return state;    
     }
}

上一篇:Python 播放音频 playsound


下一篇:[SQLite][database disk image is malformed]数据库恢复