I need to pass userId and userNickname to action authUser in authSlice reducer. authSlice: calling dispatcher Answer Simply dispatch(authUser({ userId, userNickname })); which is equivalent to dispatch(authUser({ userId: userId, userNickname: userNickname }));
Tag: redux-toolkit
React-toolkit Cannot read properties of undefined (reading ‘type’) error
I’m learning redux-toolkit and I wrote sample code, but when using useDisptach method I get “Cannot read properties of undefined (reading ‘type’)” error. What do you think is the reason for this? I am sharing the code below: my index.js file: my device.js file: my store.js file : Answer I found where I made a mistake. The import on line
Delete element from array in redux state using a reducer in createSlice
I’ve been scratching my brain for a while now with this one and any help would be appreciated. I am using React with Redux Toolkit and I’m struggling to get React to remove a ‘todo’ from my UI even though Redux is responding as expected. In Redux Developer Tools removeTodo works as expected, removing a todo from the todos array
Why my Redux reducer is undefined when I import it
Good evening, I have a small problem. I code an application with React and Redux + Redux Toolkit and simply at the time of importing my reducer in the root reducer, therefore the rootReducer, I realize that my reducer therefore unReducer was not imported correctly, here is the problem. I put the scope of my rootReducer.js in attachment with a