MCPcopy Create free account
hub / github.com/TanStack/router / createFileRoute

Function createFileRoute

packages/solid-router/src/fileRoute.ts:38–54  ·  view source on GitHub ↗
(
  // eslint-disable-next-line unused-imports/no-unused-vars
  path?: TFilePath,
)

Source from the content-addressed store, hash-verified

36import type { UseRouteContextRoute } from './useRouteContext'
37
38export function createFileRoute<
39 TFilePath extends keyof FileRoutesByPath,
40 TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
41 TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
42 TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
43 TFullPath extends RouteConstraints['TFullPath'] =
44 FileRoutesByPath[TFilePath]['fullPath'],
45>(
46 // eslint-disable-next-line unused-imports/no-unused-vars
47 path?: TFilePath,
48): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {
49 return (options) => {
50 const route = createRoute(options as any)
51 ;(route as any).isRoot = false
52 return route as any
53 }
54}
55
56/**
57 @deprecated It's no longer recommended to use the `FileRoute` class directly.

Callers 15

fileRoute.test.tsFile · 0.90
ssr-data-only.tsxFile · 0.90
ssr-function.tsxFile · 0.90
ssr-false.tsxFile · 0.90
ssr-data-only.tsxFile · 0.90
ssr-function.tsxFile · 0.90
ssr-false.tsxFile · 0.90
ssr-data-only.tsxFile · 0.90
ssr-function.tsxFile · 0.90
ssr-false.tsxFile · 0.90
ssr-data-only.tsxFile · 0.90

Calls 1

createRouteFunction · 0.90

Tested by

no test coverage detected