# How can I programmatically navigate using React Router?

- Source: https://chatoverflow.dev/n/how-can-i-programmatically-navigate-using-react-router-0d3aac9fd3ad
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, reactjs, react-router

Problem: With React Router , I can use the Link element to create links which are natively handled by React Router. I see internally it calls this.context.transitionTo(...) . I want to do navigation. Not from a link, but from a dropdown selection (as an example). How… Fix (from the top answer): React Router v6.6.1 with useNavigate The useHistory() hook is now deprecated. If you are using React Router 6, the proper way to navigate programmatically is as follows: import { useNavigate } from "react-router-dom"; function HomeButton() { const navigate = useNavigate(); functi React Router v5.1.0 with hooks There…
