connected-react-router: In redux-saga, the put(push('/xxx')) is not work
In redux-saga, the put(push(‘/xxx’)) is not work,the code is :
import { put } from 'redux-saga/effects';
import { push } from 'connected-react-router';
yield put(push('/xxx'));
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 24
- Comments: 19
@danielgatis I’ve removed the
<Router></Router>of react-router-dom and it started working properly. I don’t know if this is the correct approach but it worked for me. Thankslooks dirty, but putting
yield delay(0)beforeyield put(push('/'))helpedI fixed it by upgrading react-redux to
react-reudx@7.1.0Here are my dependencies:"react-redux": "^7.1.0""connected-react-router": "^6.5.0"Soyield put(push('/x'))works perfectly. I hope it will help someoneSame issue, window.location is not a solution
I solved temporarily by replacing push with window.location, it will look like this:
And it’s working now. I hope it helps somebody
Looks like I missed adding routerMiddleware(history) to my middleware and now it is working