2023-12-07 17:46:12
2023-12-07 17:46:12 > react@0.0.0 dev
2023-12-07 17:46:12 > vite
2023-12-07 17:46:12
2023-12-07 17:46:12
2023-12-07 17:46:12 VITE v4.4.9 ready in 369 ms
2023-12-07 17:46:12
2023-12-07 17:46:12 ➜ Local: http://localhost:5173/
2023-12-07 17:46:12 ➜ Network: use --host to expose
Local: http://localhost:5173/
const initialState: User | null = {}
removeUser: state => state = null
Type '(state: WritableDraft<User>) => null' is not assignable to type 'CaseReducer<User, { payload: any; type: string; }> | CaseReducerWithPrepare<User, PayloadAction<any, string, any, any>>'.
Type '(state: WritableDraft<User>) => null' is not assignable to type 'CaseReducer<User, { payload: any; type: string; }>'.
Type 'null' is not assignable to type 'void | User | WritableDraft<User>'.
return {
id: token.user_id,
name: token.user_name,
role: token.user_role
}
setUser
Type '(state: null, action: { payload: any; type: string; }) => { id: number; name: string; role: string | null; access_token: any; }' is not assignable to type 'CaseReducer<null, { payload: any; type: string; }> | CaseReducerWithPrepare<null, PayloadAction<any, string, any, any>>'.
Type '(state: null, action: { payload: any; type: string; }) => { id: number; name: string; role: string | null; access_token: any; }' is not assignable to type 'CaseReducer<null, { payload: any; type: string; }>'.
Type '{ id: number; name: string; role: string | null; access_token: any; }' is not assignable to type 'void'.