react-router-configuration

Configures React Router with layouts, guards, and basename for multi-layout apps.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/wonkpentink/agent-skills-fe --skill react-router-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router-configuration
Source: https://github.com/wonkpentink/agent-skills-fe/tree/main/skills/react-router-configuration
Command: npx skills add https://github.com/wonkpentink/agent-skills-fe --skill react-router-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configuring React Router across complex apps with layout-based routing, authentication guards, and basename deployment.

Core Features & Use Cases

  • Group routes by layout (PublicLayout, PrivateLayout) and nest child routes for clean separation of concerns.
  • Support basename configuration for subdirectory deployments and production environments.
  • Enable nested and dynamic routes with parameters while maintaining clear, scalable route definitions.

Quick Start

Create a browser router using PublicLayout and PrivateLayout, define your route tree, and set basename to the subdirectory where the app will be served.

Frequently Asked Questions about react-router-configuration

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

FAQPage Schema
How do I configure React Router with multiple layout wrappers for public and private pages?

React Router configuration with multiple layout wrappers groups routes by PublicLayout and PrivateLayout, nesting child routes within each layout to separate concerns and enable scalable route definitions for multi-layout applications.

What's the best way to set up a basename for React Router in a subdirectory deployment?

Setting a basename for React Router in a subdirectory deployment uses createBrowserRouter with a basename property, ensuring the router correctly resolves paths when the application is served from a subdirectory in production environments.

How do I add authentication guards to nested routes in a React Router layout?

Adding authentication guards to nested routes in a React Router layout involves wrapping PrivateLayout child routes with guard logic, preventing unauthorized access while maintaining clear route hierarchy and centralized configuration.

Can I use dynamic route parameters with nested children in createBrowserRouter?

Dynamic route parameters are supported with nested children in createBrowserRouter, allowing you to define parameter patterns within child routes while maintaining a centralized and scalable routing configuration structure.

Does this React Router configuration support separating public and private route trees?

This React Router configuration supports separating public and private route trees by assigning distinct layout wrappers to each group, enabling clean separation of concerns and centralized management of nested child routes.