| name | react-router |
| description | Master React Router v6 for production routing with error boundaries, lazy loading, and navigation guards |
| sasmp_version | 2.0.0 |
| bonded_agent | 05-routing-navigation |
| bond_type | PRIMARY_BOND |
| input_validation | {"required_packages":[{"react-router-dom":">=6.0.0"}]} |
| output_format | {"code_examples":"jsx","test_template":"jest"} |
| error_handling | {"patterns":["error_boundary","lazy_retry","404_fallback"]} |
| observability | {"logging":"structured","metrics":["navigation_count","route_load_time"]} |
React Router Skill
Overview
Master React Router v6 for building single-page applications with client-side routing, including nested routes, protected routes, and navigation patterns.
Learning Objectives
- Configure React Router
- Implement nested and dynamic routes
- Use navigation hooks and components
- Build protected routes
- Handle route parameters and search params
Quick Start
Installation
npm install react-router-dom
Basic Setup
import { BrowserRouter, Routes, Route } from 'react-router-dom';
function App() {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/users/:userId" element={<UserProfile />} />
<Route path="*" element={<NotFound />} />
</Routes>
</>
);
}