React Router Dom
react-router-dom
Declarative routing for React web applications
Routing
react
router
route
routing
history
link
react-router-dom
javascript
npm
frontend
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB
Installation
npm install react-router-domCode example
import { BrowserRouter, Routes, Route, Link } from "react-router-dom";
export function Example() {
return (
<BrowserRouter>
<nav>
<Link to="/">Home</Link>
</nav>
<Routes>
<Route path="/" element={<h1>Home</h1>} />
</Routes>
</BrowserRouter>
);
}Pros & cons
Pros
- Actively maintained by Remix Software
- 0 weekly downloads. Battle tested
- First-class TypeScript definitions
- MIT licensed
Considerations
- Adds roughly ~60 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 0 open issues on GitHub