Answers for "how to navigate in react js"

0

Programmatically navigate using react router

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

function HomeButton() {
  let history = useHistory();

  function handleClick() {
    history.push("/home");
  }

  return (
    <button type="button" onClick={handleClick}>
      Go home
    </button>
  );
}
Posted by: Guest on November-28-2019
-1

react window navigate

window.location.href = "/insert/your/path/here".
Posted by: Guest on March-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language