@clerk/react-router
3.7.6 · 19 Nov 2026MIT138.1k / weekRepositoryHomepagenpmAtom feed
2.4.19 is the newest release of 2.x.
In short
1 breaking1 new4 internal
- Breaking
Introduce React Router middleware support with
clerkMiddleware()for improved performance and streaming capabilities.
Security
1 advisory affects 2.0.0; 2.4.13 fixes them
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 2.4.13
Release note
Major Changes
- Breaking
Introduce React Router middleware support with
clerkMiddleware()for improved performance and streaming capabilities.Usage of
rootAuthLoaderwithout theclerkMiddleware()installed is now deprecated and will be removed in the next major version.Before (Deprecated - will be removed):
import { rootAuthLoader } from '@clerk/react-router/ssr.server'; export const loader = (args: Route.LoaderArgs) => rootAuthLoader(args);After (Recommended):
Enable the
v8_middlewarefuture flag:
// react-router.config.ts export default { future: { v8_middleware: true, }, } satisfies Config;Use the middleware in your app:
import { clerkMiddleware, rootAuthLoader } from '@clerk/react-router/server'; export const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]; export const loader = (args: Route.LoaderArgs) => rootAuthLoader(args);Streaming Support (with middleware):
export const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]; export const loader = (args: Route.LoaderArgs) => { const nonCriticalData = new Promise(res => setTimeout(() => res('non-critical'), 5000)); return rootAuthLoader(args, () => ({ nonCriticalData, })); };
Minor Changes
Add new <UserAvatar /> component
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.