react-router-patterns

Implement React Router v7 routing patterns with guards, layouts, and lazy loading.

1|Updated Apr 17, 2026
One-click install
npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill react-router-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router-patterns
Source: https://github.com/PremModhaOfficial/motadata-ai-pipeline/tree/main/.claude/skills/react-router-patterns
Command: npx skills add https://github.com/PremModhaOfficial/motadata-ai-pipeline --skill react-router-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides standardized React Router v7 patterns to streamline router configuration for Motadata's frontend, enabling consistent navigation structures, layouts, and guards across projects.

Core Features & Use Cases

  • Templates for createBrowserRouter setup, including nested routes and layout wrappers.
  • Lazy loading and code-splitting patterns using React.lazy and Suspense.
  • Guard patterns (AuthGuard, GuestGuard) for route protection and user flow control.
  • Breadcrumbs, 404 handling, and navigation utilities to improve user experience.
  • Use cases: applying patterns when generating new pages, features, or application sections to maintain consistency.

Quick Start

Load the router pattern templates and apply them to your app's router.tsx to start composing routes.

Frequently Asked Questions about react-router-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up React Router v7 with nested routes and layout wrappers?

Set up React Router v7 using createBrowserRouter templates that support nested routes and layout wrappers to create scalable, maintainable navigation structures. This approach standardizes router.tsx configurations for consistent application routing.

What is the best way to implement Auth and Guest guards for route protection in React?

The best way to implement route protection is using AuthGuard and GuestGuard patterns for user flow control. These guards secure protected routes and redirect authenticated users away from guest pages.

How do I add code-splitting and lazy loading to my React Router configuration?

Add code-splitting to React Router by applying lazy loading patterns using React.lazy and Suspense. This creates modular route templates that load components on demand, improving initial application performance.

Does this routing pattern template include 404 error pages and breadcrumb generation?

Yes, the routing pattern templates include 404 handling and breadcrumb navigation utilities. These features improve user experience by providing fallback pages and contextual navigation paths across nested routes.

Can I use these React Router patterns when generating new features and application sections?

Yes, you can apply these React Router patterns when generating new pages, features, or application sections. The templates provide reusable route utilities that maintain consistent navigation structures across the project.