Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 1.09 KB

File metadata and controls

37 lines (23 loc) · 1.09 KB

@languages-learner/react-router-utils

Shared React Router utilities, including locale-aware routing helpers.

Purpose

Centralizes routing helpers used by the app and by test utilities — typed hrefs, locale-prefixed routes, and a router middleware helper.

Public API / exports

From src/index.ts:

  • middleware, type MiddlewareProps — router middleware helper.
  • createHrefTyped, type PathParams — build type-safe hrefs.
  • patchToWithLocale — locale-prefix a route target.
  • useIsRouteMatched — check whether a route matches.
  • makeRoutesWithLocale, type RouteObject, type RouteObjectWithLocales — build locale-aware route trees.

Depends on

  • No workspace packages.

Used in

  • apps/web, @languages-learner/playwright-utils.

Notes

  • Locale handling here pairs with locale and the app's i18n pipeline (i18n.md).

Links