A powerful React application built to master client-side routing, nested layouts, and asynchronous data fetching. This project demonstrates how to build a seamless user experience using the latest React Router features.
- Nested Routing: Implemented a
Rootlayout with a Shared Header, Sidebar, and Footer using the<Outlet />component. - Dynamic Routing & Params: Created specialized detail pages for Users and Posts using dynamic segments like
:userIdand:postId. - Advanced Data Fetching: Mastered the use of
useLoaderDatato pre-fetch API data from JSONPlaceholder before component rendering. - Programmatic Navigation: Implemented the
useNavigatehook for custom button-clicks and a "Go Back" feature usingMaps(-1). - Active Navigation Styling: Used
<NavLink />to provide real-time visual feedback for the currently active route. - Async Handling: Explored the use of
<Suspense />and custom promises for handling data-heavy components.
- React.js (Functional Components & Hooks)
- React Router (Version 6+)
- JSONPlaceholder API (External Data Source)
- CSS3 (Custom Layouts & Sidebar Styling)
src/
├── Components/
│ ├── Root/ # Main Layout Wrapper
│ ├── Header/ # Navbar with Active States
│ ├── Sidebar/ # Navigation Sidebar
│ ├── Users/ # User List with Loaders
│ ├── UserDetails/ # Dynamic Single User View
│ ├── Posts/ # Post List with Loaders
│ └── PostDetail/ # Dynamic Individual Post View
├── main.jsx # Central Route Definition & Logic
└── index.css # Global Styles