Clerk React Router Patterns
React Router v7/v8 patterns with Clerk — rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, org switching. Triggers on: react-router auth, rootAuthLoader, getAuth loader, react-router protected route, loader authentication, SSR auth react-router, useNavigate may be used only in the context of a Router.
- Type
- Skill
- Author
- clerk
- Category
- Frontend
- GitHub stars
- 89
- Installs
- 15.6K
- Last updated
- October 30, 2026
Install
npx skills add https://github.com/clerk/skills --skill clerk-react-router-patternsUse cases
- Add Clerk auth to a React Router v7 or v8 app.
- Protect routes with rootAuthLoader and getAuth in loaders.
- Debug the useNavigate context error in a React Router app.
Frequently Asked Questions
Which React Router versions are covered?
React Router v7 and v8.
What auth patterns does it show?
rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, and org switching.
Does it help with the useNavigate error?
Yes — it addresses the 'useNavigate may be used only in the context of a Router' error.
About this skill
Covers React Router v7 and v8 auth patterns with Clerk: rootAuthLoader, getAuth in loaders, clerkMiddleware, protected routes, SSR user data, and organization switching. Use it when adding authentication to a React Router app or debugging loader-level auth. It also addresses the common "useNavigate may be used only in the context of a Router" error.
Summary written with AI assistance from the project's public description.
Categories
More from clerk
Clerk Setup
Add Clerk authentication to any project by following the official quickstart guides.
by clerk
Clerk Custom Ui
Custom authentication flows and component appearance - hooks (useSignIn, useSignUp), themes, colors, fonts, CSS. Use for custom sign-in/sign-up flo...
by clerk
Clerk Backend Api
Clerk Backend REST API explorer and executor. Browse tags, inspect endpoint schemas, and execute authenticated requests. Use when listing users, ma...
by clerk
Clerk Nextjs Patterns
Advanced Next.js patterns - middleware, Server Actions, caching with Clerk.
by clerk
Similar Skills
Find Skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", o...
by vercel-labs
Grill Me
A relentless interview to sharpen a plan or design.
by mattpocock
Ai Video Generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0,...
by inference-sh
Ai Image Generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FL...
by inference-sh