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

Function createFileRoute

packages/react-router/src/fileRoute.ts:50–68  ·  view source on GitHub ↗
(
  path?: TFilePath,
)

Source from the content-addressed store, hash-verified

48 * @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
49 */
50export function createFileRoute<
51 TFilePath extends keyof FileRoutesByPath,
52 TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
53 TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'],
54 TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'],
55 TFullPath extends RouteConstraints['TFullPath'] =
56 FileRoutesByPath[TFilePath]['fullPath'],
57>(
58 path?: TFilePath,
59): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'] {
60 if (typeof path === 'object') {
61 return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {
62 silent: true,
63 }).createRoute(path) as any
64 }
65 return new FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>(path, {
66 silent: true,
67 }).createRoute
68}
69
70/**
71 @deprecated It's no longer recommended to use the `FileRoute` class directly.

Callers 15

index.tsxFile · 0.90
[_]auth.route.tsxFile · 0.90
[_]hello.tsxFile · 0.90
index.tsxFile · 0.90
index.tsxFile · 0.90
settings.tsxFile · 0.90
route.tsxFile · 0.90
$slug.tsxFile · 0.90
index.tsxFile · 0.90
stats.tsxFile · 0.90
route.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected