Call function after dispatch from redux has finished

后端 未结 5 603
-上瘾入骨i
-上瘾入骨i 2020-12-14 20:48

All around it but not quite as I have enough of an idea of redux-thunk and of react-router but I am not getting this seemingly simple idea of:

5条回答
  •  醉话见心
    2020-12-14 21:36

    According to this stackoverflow answer: Is store.dispatch in Redux synchronous or asynchronous, redux dispatch functions are synchronous therefore, you can do this:

    LogIn();
    history.push("/");
    

提交回复
热议问题