History.push.hook

import { useHistory } from "react-router-dom";

export const usePushHistory = () => {
  const history = useHistory();

  const onChangePage = (value) => {
    history.push({ pathname: value });
  };

  return {
    onChangePage,
  };
};
Stern