javascript - Redux transition to after action execution -
i have action export function loginsuccess(response){ return (dispatch, getstate) => { dispatch({ response, type: types.login }); router.transitionto("/profile") }; } here after successful execution of action redirect /profile . here getting router not defined . you have pass router redux thunk action creator (you pice of code not action wrote action creator). example looks like: export function loginsuccess(router, response){ return (dispatch, getstate) => { dispatch({ response, type: types.login }); router.transitionto("/profile") }; } do have access router in place invoke action creator ? available there? if yes have there (i don't know response ): this.props.dispatch(loginsuccess(response)); and have change to: this.props.dispatch(loginsuccess(this.context.router, response)); i assume have access router context. because don't show how invoke action i'm guessing. hope instruction you. ...