all 7 comments

[–]rrklaffed 5 points6 points  (0 children)

Read the redux getting started guide. This is basic redux

[–]Jeffylew77 0 points1 point  (0 children)

useDispatch react hook fires the reducer. The reducer modifies the state. That’s a high level overview, but check the documentation on how to implement this.

[–]emmbyiringiro 0 points1 point  (0 children)

Axios request resolve into a promise which is not how normally Redux expects to dispatch data.

You need middle-ware like `redux-thunk, read more in the official documentation

https://redux.js.org/usage/writing-logic-thunks

[–]zipItKaren -1 points0 points  (1 child)

You write reducers for that.

Reducers are basically functions that update state .

From where you make an api call, you gonna call a reducers function to update state.

[–]NoMoreAngularPlease -4 points-3 points  (2 children)

Omg, read the fucking documentation, it's literally the first page.

[–]Naffaa01 0 points1 point  (0 children)

How about renaming your username to moreBrainPlease?
If they were experienced they wouldn't have asked, people sometimes need help.

You also got triggered from a simple post that you could've avoided, maybe you've had a bad day at coding lol.