The app already pulls items from the HTTP API server, but they are currently just being put in local state. We'll convert that local state to Redux by dispatching a setTodos action with the result of that HTTP call.
Summary of Content:
- Create a new setTodos action, which sets the todo items in the todos reducer
- Use the setTodos action to pass all the new items to the reducer
- Modify the todos reducer to set the todos to the new list of todos from the server
Your instructions here were:
To import the new action, just like you did for addItem.
And then make sure to add it to the 2nd argument of connect, otherwise it won't work properly.
And it can sometimes be tricky to figure out the error.
Great. Okay. Understood.
Now fast forward 4 days, and I am trying to do this on my own (4 days after watching this video)
I then wasted 3 hours, yes, 3 freakin hours, with it not working, and what did I find as a solution 3 long, tiring hours later?
Yup, I had forgotten to add it to the dang 2nd argument of connect !!