import getHistory from './history'; export const goToPage = () => (dispatch) => { dispatch({ type: GO_TO_SUCCESS_PAGE }); getHistory().push('/success'); // at this point component probably has been mounted and we can safely get `history` };