🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEreact

react Documentation

LOADING ENGINE...

React useNavigate

Master React components, hooks, and best practices.

useNavigate

Author

Pascual Vila

Frontend Instructor.

useNavigate is a React Router Hook that allows you to navigate to different routes programmatically. It's useful when you need to perform a redirection after an action like a form submission or an event.

Example of useNavigate usage:

          {`import React from "react";
          import { useNavigate } from "react-router-dom";
          
          function MyComponent() {
            const navigate = useNavigate();
            
            const handleClick = () => {
              navigate("/about");
            };
            
            return (
              
); } export default MyComponent;`}