Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

history.push.hook

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

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

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

  return {
    onChangePage,
  };
};
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+5 =