werkbank
    Preparing search index...

    Function createRouter

    • Creates a router configuration object by combining route definitions with their handlers.

      Type Parameters

      • C extends Readonly<{ [route: string]: RouteOption }>

        The routes configuration type.

      • RouterContext

        The type of the router context.

      • ParentParams extends any[] = []

        The type of the parent route parameters.

      Parameters

      • config: C

        The static routes configuration.

      • routerConfig: CreateRouterConfig<C, RouterContext, ParentParams>

        The runtime router configuration (handlers).

      • Optionalkeypath: string

        Internal use only. The current key path for nested routes.

      Returns InferredRouterConfig<C, RouterContext>

      The fully inferred and frozen router configuration.

      This function processes the static route definitions (paths, search params) and the runtime route handlers (components, loaders) to create a unified router configuration. It recursively handles nested routes.

      Error Thrown if the configuration is invalid or missing.