Using redux-saga with react-router

六眼飞鱼酱① 提交于 2019-12-22 10:27:39

问题


I have a question about react-router: for example, I want to redirect from Create form to Edit form after called to create api (using redux-saga) successfully. How should I use react-router in this case?


回答1:


If you include also react-router-redux you can simply treat the page change as another redux action to call from saga (using the new push API).

Something like...

yield put(push('your/route'))


来源:https://stackoverflow.com/questions/45878719/using-redux-saga-with-react-router

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!