preloadRoutePattern

unstable_preloadRoutePattern



This API is experimental and subject to breaking changes in minor/patch releases. Please use with caution and pay very close attention to release notes for relevant changes.

Summary

Initialize the route-pattern matcher before creating a Data Router or static handler with future.unstable_routePatternMatching enabled. Import from react-router/route-pattern and call this once during application startup. Server and browser applications must each preload their own matcher.

The matcher is statically imported by this module. Tree-shaking bundlers can remove it from applications that do not use this function. Initialization is synchronous, and repeated calls are safe.

Signature

function unstable_preloadRoutePattern(): void

Returns

No return value.

Docs and examples CC 4.0
Edit