can pure component make api calls? code example
Example 1: pure components
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`
};
Example 2: pure components
import { browserHistory } from 'react-router';
browserHistory.push('/some/path');