DEV Community

Harish raj
Harish raj

Posted on

useNavigate() in React

React Router v6 introduces the useNavigate() hook, making it easier and more flexible to navigate between different pages in your app. It replaces the older useHistory() hook.

functionapp(){
const navigate = usenavigate();
function changeintoabout(){
navigate("/
about")
return (

o/p if the button click it will be navigate

Top comments (0)