I am following a MERN tutorial (studying it at the same time) and after creating auth slice for the app, I can't see my state in Redux dev tools. It shows null(pin):undefined
I'm pretty sure I haven't made a typo. This is what I should be getting
Here's my auth code if it's any help:
// Get user from localStorage
const user = JSON.parse(localStorage.getItem('user'))
const initialState = {
user: user ? user : null,
isError: false,
isSuccess: false,
isLoading: false,
message: "",
};
export const authSlice = createSlice({
name:"auth",
initialState,
reducers: {
reset:(state) => {
state.isLoading = false
state.isError = false
state.isSuccess = false
state.message = ''
}
},
extraReducers: () => {}
})
export const {reset} = authSlice.actions
export default authSlice.reducer
I import this in the store.js file which is rendered in index.js