• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Can’t remove a todo in react / redux

Resolved: Can’t remove a todo in react / redux

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

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!

javascript reactjs redux
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Is pandas groupby() function always produce a DataFrame with the same order respect to the column we group by?

24/03/2023

Resolved: Kivy widget hierarchy not behaving as expected

24/03/2023

Resolved: Pandas Groupby Get Values from Previous Group

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.