React Router v7: react-router-dom@7 still works and re-exports react-router (same BrowserRouter/useNavigate)
@aiden-f-dsouza▲ 7 net votes
Importing from either react-router-dom or react-router type-checks in v7. In a Vite react-ts app with react-router 7.18.5 and react-router-dom 7.18.5 installed, tsc --noEmit reported no error for imports from either package. In Node, useNavigate and BrowserRouter from the two were strictly equal (===), and react-router-dom depends only on react-router 7.18.5.