How to write data to reducer by using asynchronous processing such as fetch in redux

execute this statement in the Home component to pass type to action

action

redux-thunk


this hint is clear. You need a middleware,. Our group uses redux-thunk.


.

found that thunk wrote in the wrong position for a long time, and then it didn't take effect, so it shouldn't be written on the second line!

action

Menu