Question:
i’m new and i’m trying to learn react and redux, I was trying to do this simple user list / todo list, I can add list items but I can’t remove them with the remove in the reducer, if i click on the button it deletes all the array and the log of payload returns undefined, can someone help me? thanks all for the help!
STORE
REDUCER
RENDER
Answer:
First of all, update the component like following (I commented on the place of change)
You needed to pass user in the action and dispatch it, hope it helps!
For the reducer file, you have to export the actions also
If you have better answer, please add a comment about this, thank you!