MCPcopy
hub / github.com/TanStack/router / createFileRoute

Function createFileRoute

packages/solid-router/src/fileRoute.ts:39–57  ·  view source on GitHub ↗
(
  path?: TFilePath,
)

Source from the content-addressed store, hash-verified

37import type { UseRouteContextRoute } from './useRouteContext'
38
39export function createFileRoute<
40 TFilePath extends keyof FileRoutesByPath,
41 TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
42 TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
43 TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
44 TFullPath extends RouteConstraints['TFullPath'] =
45 FileRoutesByPath[TFilePath]['fullPath'],
46>(
47 path?: TFilePath,
48): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {
49 if (typeof path === 'object') {
50 return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {
51 silent: true,
52 }).createRoute(path) as any
53 }
54 return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {
55 silent: true,
56 }).createRoute
57}
58
59/**
60 @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

no outgoing calls

Tested by

no test coverage detected