Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Use History React Router v6 app

// This is a React Router v6 app
import { useNavigate } from "react-router-dom";

function App() {
  let navigate = useNavigate();
  function handleClick() {
    navigate("/home");
  }
  return (
    <div>
      <button onClick={handleClick}>go home</button>
    </div>
  );
}
Source by reactrouter.com #
 
PREVIOUS NEXT
Tagged: #Use #History #React #Router #app
ADD COMMENT
Topic
Name
2+7 =