react-router-sibling-route-conflict

Diagnose and fix react-router v6/v7 sibling route shadowing conflicts.

2|Updated May 10, 2026
One-click install
npx skills add https://github.com/freedomw1987/tree_monstor --skill react-router-sibling-route-conflict
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-router-sibling-route-conflict
Source: https://github.com/freedomw1987/tree_monstor/tree/main/skills/react-router-sibling-route-conflict
Command: npx skills add https://github.com/freedomw1987/tree_monstor --skill react-router-sibling-route-conflict

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the common, silent react-router v6/v7 bug where two sibling routes with overlapping paths (such as a top-level /settings route and a /settings/* layout route) cause route shadowing. This leads to blank layout outlets or incorrect page rendering even when TypeScript compiles with zero errors, making the issue hard to detect without manual browser testing.

Core Features & Use Cases

  • Diagnoses the root cause of sibling route shadowing between overlapping path declarations in react-router v6/v7 configurations.
  • Provides 3 proven fix patterns (nested layout with index route, legacy route redirect, order-dependent sibling, or full path renaming) tailored to different refactor constraints and legacy link preservation needs.
  • Includes mandatory browser smoke test steps to verify fixes, avoiding false positives from passing TypeScript checks alone.
  • Common use case: When upgrading a legacy react-router v5 application to v6/v7, use this skill to fix broken settings routes that show blank layouts after adding new settings subpages.

Quick Start

Use the react-router-sibling-route-conflict skill to diagnose and fix the blank layout issue on your /settings route after adding a /settings/users subroute.

Frequently Asked Questions about react-router-sibling-route-conflict

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

FAQPage Schema
Why does my react-router v6 layout route render a blank outlet when TypeScript compiles without errors?

A blank layout outlet in react-router v6 typically indicates sibling route shadowing, where overlapping path declarations between top-level and nested layout routes silently override each other despite TypeScript compiling without errors.

What is the best way to fix overlapping path declarations in react-router v7?

To fix overlapping path declarations in react-router v7, apply one of three patterns: nested layout with index route, legacy route redirect, or full path renaming, tailored to your refactor constraints and legacy link preservation needs.

How do I prevent route shadowing when upgrading a legacy react-router v5 application to v6?

When upgrading from react-router v5 to v6, prevent route shadowing by reconfiguring overlapping sibling paths into nested layout routes with index routes, and running mandatory browser smoke tests to verify rendering behavior.

Can I rely on TypeScript checks alone to catch silent routing failures in react-router?

No, TypeScript checks cannot catch silent routing failures in react-router because path shadowing passes type validation, making mandatory browser smoke test procedures essential to verify actual routing behavior and avoid false positives.

Does react-router v6 route matching depend on the order of sibling route declarations?

React-router v6/v7 sibling route shadowing can cause order-dependent route matching when paths overlap, meaning the router might render the incorrect page based on declaration sequence rather than path specificity.

How do I preserve legacy links when renaming full paths to fix react-router sibling conflicts?

To preserve legacy links when fixing react-router sibling conflicts, use the legacy route redirect pattern to map old overlapping top-level paths to the new nested layout structure, ensuring existing URLs remain accessible.