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.
原因: 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;
}
}