Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions packages/react-router/src/ClientOnly.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ export interface ClientOnlyProps {
* )
* ```
*/
/**
* Render children only after client hydration; otherwise render `fallback`.
* Useful for components that require browser-only APIs.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/clientOnlyComponent
*/
export function ClientOnly({ children, fallback = null }: ClientOnlyProps) {
return useHydrated() ? (
<React.Fragment>{children}</React.Fragment>
Expand Down Expand Up @@ -60,9 +55,6 @@ export function ClientOnly({ children, fallback = null }: ClientOnlyProps) {
* ```
* @returns True if the JS has been hydrated already, false otherwise.
*/
/**
* Return a boolean indicating whether client hydration has occurred.
*/
export function useHydrated(): boolean {
return React.useSyncExternalStore(
subscribe,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/HeadContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ export const useTags = () => {
)
}

/**
* @description The `HeadContent` component is used to render meta tags, links, and scripts for the current route.
* It should be rendered in the `<head>` of your document.
*/
/**
* Render route-managed head tags (title, meta, links, styles, head scripts).
* Place inside the document head of your app shell.
Expand Down
12 changes: 0 additions & 12 deletions packages/react-router/src/Matches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ declare module '@tanstack/router-core' {
}
}

/**
* Internal component that renders the router's active match tree with
* suspense, error, and not-found boundaries. Rendered by `RouterProvider`.
*/
/**
* Internal component that renders the router's active match tree with
* suspense, error, and not-found boundaries. Rendered by `RouterProvider`.
Expand Down Expand Up @@ -263,10 +259,6 @@ export function useMatches<
*
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchesHook
*/
/**
* Read the full array of active route matches or select a derived subset
* from the parent boundary up to (but not including) the current match.
*/
export function useParentMatches<
TRouter extends AnyRouter = RegisteredRouter,
TSelected = unknown,
Expand All @@ -289,10 +281,6 @@ export function useParentMatches<
} as any)
}

/**
* Read the array of active route matches that are children of the current
* match (or selected parent) in the match tree.
*/
/**
* Read the array of active route matches that are children of the current
* match (or selected parent) in the match tree.
Expand Down
9 changes: 0 additions & 9 deletions packages/react-router/src/RouterProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import type {
RouterOptions,
} from '@tanstack/router-core'

/**
* Low-level provider that places the router into React context and optionally
* updates router options from props. Most apps should use `RouterProvider`.
*/
/**
* Low-level provider that places the router into React context and optionally
* updates router options from props. Most apps should use `RouterProvider`.
Expand Down Expand Up @@ -61,11 +57,6 @@ export function RouterContextProvider<
*
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
/**
* Top-level component that renders the active route matches and provides the
* router to the React tree via context. Accepts the same options as
* `createRouter` via props to update the router instance.
*/
export function RouterProvider<
TRouter extends AnyRouter = RegisteredRouter,
TDehydrated extends Record<string, any> = Record<string, any>,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/Scripts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { useRouterState } from './useRouterState'
import { useRouter } from './useRouter'
import type { RouterManagedTag } from '@tanstack/router-core'

/**
* Render body script tags collected from route matches and SSR manifests.
* Should be placed near the end of the document body.
*/
/**
* Render body script tags collected from route matches and SSR manifests.
* Should be placed near the end of the document body.
Expand Down
5 changes: 0 additions & 5 deletions packages/react-router/src/awaited.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type AwaitOptions<T> = {
promise: Promise<T>
}

/** Suspend until a deferred promise resolves/rejects and return its data. */
/** Suspend until a deferred promise resolves or rejects and return its data. */
export function useAwaited<T>({
promise: _promise,
Expand All @@ -25,10 +24,6 @@ export function useAwaited<T>({
return [promise[TSR_DEFERRED_PROMISE].data, promise]
}

/**
* Component that suspends on a deferred promise and renders its child with
* the resolved value. Optionally provides a Suspense fallback.
*/
/**
* Component that suspends on a deferred promise and renders its child with
* the resolved value. Optionally provides a Suspense fallback.
Expand Down
60 changes: 0 additions & 60 deletions packages/react-router/src/fileRoute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont remove this

import warning from 'tiny-warning'
import { createRoute } from './route'

Expand Down Expand Up @@ -47,24 +46,6 @@ import type { UseRouteContextRoute } from './useRouteContext'
* @returns A function that accepts Route options and returns a Route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
*/
/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still has duplicated jsdocs

* Creates a file-based Route factory for a given path.
*
* Used by TanStack Router's file-based routing to associate a file with a
* route. The returned function accepts standard route options. In normal usage
* the `path` string is inserted and maintained by the `tsr` generator.
*
* @param path File path literal for the route (usually auto-generated).
* @returns A function that accepts Route options and returns a Route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
*/
/**
* Creates a file-based Route factory for a given path.
* Used by file-based routing to associate a file with a route. The returned
* function accepts standard route options; the path is typically auto-managed
* by the generator.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createFileRouteFunction
*/
export function createFileRoute<
TFilePath extends keyof FileRoutesByPath,
TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'],
Expand Down Expand Up @@ -178,16 +159,6 @@ export class FileRoute<
}
}

/**
@deprecated It's recommended not to split loaders into separate files.
Instead, place the loader function in the the main route file, inside the
`createFileRoute('/path/to/file)(options)` options.
*/
/**
@deprecated It's recommended not to split loaders into separate files.
Instead, place the loader function in the the main route file, inside the
`createFileRoute('/path/to/file)(options)` options.
*/
/**
@deprecated It's recommended not to split loaders into separate files.
Instead, place the loader function in the main route file via `createFileRoute`.
Expand Down Expand Up @@ -304,22 +275,6 @@ export class LazyRoute<TRoute extends AnyRoute> {
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
*/
/**
* Creates a lazily-configurable code-based route stub by ID.
*
* Use this for code-splitting with code-based routes. The returned function
* accepts only non-critical route options like `component`, `pendingComponent`,
* `errorComponent`, and `notFoundComponent` which are applied when the route
* is matched.
*
* @param id Route ID string literal to associate with the lazy route.
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
*/
/**
* Create a lazily-configurable code-based route stub by ID.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyRouteFunction
*/
export function createLazyRoute<
TRouter extends AnyRouter = RegisteredRouter,
TId extends string = string,
Expand All @@ -344,21 +299,6 @@ export function createLazyRoute<
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
*/
/**
* Creates a lazily-configurable file-based route stub by file path.
*
* Use this for code-splitting with file-based routes (eg. `.lazy.tsx` files).
* The returned function accepts only non-critical route options like
* `component`, `pendingComponent`, `errorComponent`, and `notFoundComponent`.
*
* @param id File path literal for the route file.
* @returns A function that accepts lazy route options and returns a `LazyRoute`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
*/
/**
* Create a lazily-configurable file-based route stub by file path.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createLazyFileRouteFunction
*/
export function createLazyFileRoute<
TFilePath extends keyof FileRoutesByPath,
TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute'],
Expand Down
5 changes: 0 additions & 5 deletions packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ declare module '@tanstack/router-core' {
* @returns A Router instance to be provided to `RouterProvider`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
/**
* Create a new React router instance from `RouterOptions`.
* Pass the resulting router to `RouterProvider`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
export const createRouter: CreateRouterFn = (options) => {
return new Router(options)
}
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/useBlocker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ export function useBlocker<
*/
export function useBlocker(blockerFnOrOpts?: LegacyBlockerOpts): BlockerResolver

/**
* @deprecated Use the UseBlockerOpts object syntax instead
*/
export function useBlocker(
blockerFn?: LegacyBlockerFn,
condition?: boolean | any,
): BlockerResolver
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/useLoaderData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export type UseLoaderDataRoute<out TId> = <
* @returns The loader data (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook
*/
/**
* Read and select the current route's loader data with type‑safety.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook
*/
export function useLoaderData<
TRouter extends AnyRouter = RegisteredRouter,
const TFrom extends string | undefined = undefined,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/useLoaderDeps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ export type UseLoaderDepsRoute<out TId> = <
* @returns The loader deps (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook
*/
/**
* Read and select the current route's loader dependencies object.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDepsHook
*/
export function useLoaderDeps<
TRouter extends AnyRouter = RegisteredRouter,
const TFrom extends string | undefined = undefined,
Expand Down
5 changes: 0 additions & 5 deletions packages/react-router/src/useLocation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ export type UseLocationResult<
* @returns The current location (or selected value).
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook
*/
/**
* Read the current location from the router state with optional selection.
* Useful for subscribing to just the pieces of location you care about.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLocationHook
*/
export function useLocation<
TRouter extends AnyRouter = RegisteredRouter,
TSelected = unknown,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/useParams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export type UseParamsRoute<out TFrom> = <
* @returns The params object (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
*/
/**
* Access the current route's path parameters with type-safety.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
*/
export function useParams<
TRouter extends AnyRouter = RegisteredRouter,
const TFrom extends string | undefined = undefined,
Expand Down
5 changes: 0 additions & 5 deletions packages/react-router/src/useRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core'
* @returns The registered router instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook
*/
/**
* Access the current TanStack Router instance from React context.
* Must be used within a `RouterProvider`.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterHook
*/
export function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {
warn?: boolean
}): TRouter {
Expand Down
5 changes: 0 additions & 5 deletions packages/react-router/src/useRouterState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ export type UseRouterStateResult<
* @returns The selected router state (or the full state by default).
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook
*/
/**
* Subscribe to the router's state store with optional selection and
* structural sharing for render optimization.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useRouterStateHook
*/
export function useRouterState<
TRouter extends AnyRouter = RegisteredRouter,
TSelected = unknown,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-router/src/useSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export type UseSearchRoute<out TFrom> = <
* @returns The search object (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
*/
/**
* Read and select the current route's search parameters with type-safety.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useSearchHook
*/
export function useSearch<
TRouter extends AnyRouter = RegisteredRouter,
const TFrom extends string | undefined = undefined,
Expand Down
6 changes: 0 additions & 6 deletions packages/router-core/src/Matches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ export type MakeRouteMatchUnion<
>
: never

/**
* The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.
*
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)
*/
export interface MatchRouteOptions {
/**
* If `true`, will match against pending location instead of the current location.
*
Expand Down
Loading
Loading