-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
There seems to be two ways to redirect from an action creator (react-redux):
-
Use withRouter() on component which calls the action creator and pass
props.router
to the action creator (e.g.dispatch(login(username, password, this.props.router))
androuter.push('/success')
inside my action creator) -
import { browserHistory } from 'react-router'
inside the action creator file andbrowserHistory.push('/success')
as mentioned here: https://github.com/reactjs/react-router/blob/master/docs/guides/NavigatingOutsideOfComponents.md
I was wondering which one would be preferable.
davidpelayo, pablen, olalonde, alexpricedev, tutok and 24 moreservomac, passportradio, lmsmartins and praveensanap
Metadata
Metadata
Assignees
Labels
No labels