Skip to content

docs: add jsdoc comments to plugin/generator types #4204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 103 commits into from
Closed
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
855b03f
Devinxi (#4111)
tannerlinsley May 10, 2025
6e5b7a3
fix: RELEASE_ALL
schiller-manuel May 10, 2025
1ceda30
release: v1.20.3-alpha.1
tannerlinsley May 10, 2025
0b7aefd
fix: RELEASE_ALL
schiller-manuel May 10, 2025
bc2dfa1
release: v1.120.4-alpha.1
tannerlinsley May 10, 2025
e3fd36b
fix: clean up Vite versions (#4130)
XiNiHa May 10, 2025
82d14bd
docs(start): Fix contents outdated by Devinxi (#4125)
XiNiHa May 10, 2025
c997f90
release: v1.120.4-alpha.2
tannerlinsley May 10, 2025
736a572
fix: declare `vite` as a `peerDependency` (#4135)
SeanCassiere May 10, 2025
99a944b
release: v1.120.4-alpha.3
tannerlinsley May 10, 2025
35f6520
fix(router-generator): exit conditions when using `verboseFileRoutes`…
SeanCassiere May 11, 2025
ef337e7
release: v1.120.4-alpha.4
tannerlinsley May 11, 2025
94400a2
fix(start-plugin-core): patches for Virtual Routes in Server Routes (…
SeanCassiere May 11, 2025
016e5f0
release: v1.120.4-alpha.5
tannerlinsley May 11, 2025
20937af
fix(start-plugin-core): include "vite/client" types (#4139)
SeanCassiere May 11, 2025
a57676e
release: v1.120.4-alpha.6
tannerlinsley May 11, 2025
d5c2e6d
fix(start-server-core): appending headers to immutable response objec…
MoeedDar May 11, 2025
bef4dab
ci: apply automated fixes
autofix-ci[bot] May 11, 2025
565c8a0
chore: lint
schiller-manuel May 11, 2025
6542287
release: v1.120.4-alpha.7
tannerlinsley May 11, 2025
94c1284
refactor(start-server-core): use utility functions from router-core (…
SeanCassiere May 11, 2025
4533d30
release: v1.120.4-alpha.8
tannerlinsley May 11, 2025
62a044e
docs(start): remove validators from "server routes" guide (#4148)
ssijak May 11, 2025
ac7db71
fix(start-plugin-core): remove backslashes from declaration import (#…
SeanCassiere May 11, 2025
32f1a8b
release: v1.120.4-alpha.9
tannerlinsley May 11, 2025
9f63d40
feat(router-core): type level parsing of path params (#4144)
chorobin May 11, 2025
8d4a7e8
release: v1.120.4-alpha.10
tannerlinsley May 11, 2025
6bde41f
docs(start): Server Functions can be called from Server Routes (#4154)
ryanagillie May 12, 2025
e6fab6a
docs(start): server-routes (#4155)
schiller-manuel May 12, 2025
418fac9
docs: update build from scratch
schiller-manuel May 12, 2025
3f33f04
fix: remove set/get global origin (#4157)
schiller-manuel May 12, 2025
6f764c2
release: v1.120.4-alpha.11
tannerlinsley May 12, 2025
9882e30
fix: properly handle redirects thrown by server functions (#4156)
schiller-manuel May 12, 2025
6d428d3
release: v1.120.4-alpha.12
tannerlinsley May 12, 2025
c81090d
docs(start): document that serverFn can be used in server routes (#4152)
kandros May 12, 2025
abb047e
fix: remove unused header (#4160)
schiller-manuel May 12, 2025
4e0638b
feat(react-start): Wrap default client entry with `<StrictMode>` (#4159)
ryanagillie May 12, 2025
55e54e1
release: v1.120.4-alpha.13
tannerlinsley May 12, 2025
a153fda
docs(start): update src path for images
birkskyum May 13, 2025
2559877
fix: remove undici (#4168)
schiller-manuel May 13, 2025
0a66147
release: v1.120.4-alpha.14
tannerlinsley May 13, 2025
273c4c1
feat: shell mode
tannerlinsley May 13, 2025
1e894bc
solidjs shell mode
birkskyum May 13, 2025
4225562
ci: apply automated fixes
autofix-ci[bot] May 13, 2025
10eed5f
fix: Do not default to shell mode
tannerlinsley May 13, 2025
f727dac
fix: nitro-plugin types
tannerlinsley May 13, 2025
3cbd11a
release: v1.120.4-alpha.15
tannerlinsley May 13, 2025
1417d17
fix: ensure compatibility with vite plugins that don't support the vi…
schiller-manuel May 13, 2025
063ccf6
release: v1.120.4-alpha.16
tannerlinsley May 13, 2025
9fd4290
docs(solid-start): correctly set link to spa-shell
birkskyum May 14, 2025
475556e
docs(solid-start): fix server routes docs
birkskyum May 14, 2025
14bcc58
fix: recover from server pathname mismatch
tannerlinsley May 14, 2025
595b0d0
release: v1.120.4-alpha.17
tannerlinsley May 14, 2025
0cca049
chore: dedupe and fix lockfile (#4171)
SeanCassiere May 15, 2025
16705fa
fix: resolve custom `client` and `server` entry paths (#4172)
SeanCassiere May 15, 2025
fbfd801
release: v1.120.4-alpha.18
tannerlinsley May 15, 2025
f940f85
docs(server.ts/ssr.ts): cleanup redundant files and update docs
birkskyum May 15, 2025
5f8506b
ci: apply automated fixes
autofix-ci[bot] May 15, 2025
7f5ba87
fix: relative runtime navigation (#4174)
tannerlinsley May 15, 2025
52cdc7e
release: v1.120.4-alpha.19
tannerlinsley May 15, 2025
b901793
fix: spa-mode (#4177)
tannerlinsley May 15, 2025
4aa766b
release: v1.120.4-alpha.20
tannerlinsley May 15, 2025
b424cad
fix: no `@fs` in dev for client entry (#4179)
tannerlinsley May 15, 2025
b5affb2
release: v1.120.4-alpha.21
tannerlinsley May 15, 2025
f209861
fix: resolve custom `server` entry path on windows fs (#4180)
yjoer May 15, 2025
7cf6487
release: v1.120.4-alpha.22
tannerlinsley May 15, 2025
b339e67
fix: resolve custom `client` entry path on windows fs (#4181)
SeanCassiere May 15, 2025
cb21bb5
release: v1.120.4-alpha.23
tannerlinsley May 15, 2025
f430560
feat(start-server-core): resolve relative requests to the same origin…
SeanCassiere May 16, 2025
7a6cbee
release: v1.120.4-alpha.24
tannerlinsley May 16, 2025
9e0d2d6
fix(start-plugin-core): enable pre-rendering with just `pages` (#4185)
SeanCassiere May 16, 2025
fda4179
release: v1.120.4-alpha.25
tannerlinsley May 16, 2025
15b8ed6
chore: various fixes (#4187)
schiller-manuel May 16, 2025
f2d1d54
merge main (#4191)
schiller-manuel May 16, 2025
e03ad0c
fix: RELEASE_ALL
SeanCassiere May 16, 2025
ed33706
release: v1.121.0-alpha.1
tannerlinsley May 16, 2025
6187e24
fix: add support for 'using' (#4194)
schiller-manuel May 17, 2025
8fee26d
release: v1.121.0-alpha.2
tannerlinsley May 17, 2025
3f8dacd
chore: simplify test for 'using' (#4196)
schiller-manuel May 17, 2025
0f12171
chore: router plugin restructuring (#4199)
schiller-manuel May 18, 2025
7a59ab5
add jsdoc comments to plugin/generator types
RMHonor May 18, 2025
e9e36c5
whitespace
RMHonor May 19, 2025
487d1bc
fix: allow head to be async (#4213)
schiller-manuel May 20, 2025
e5e8e02
release: v1.121.0-alpha.3
tannerlinsley May 20, 2025
3a5a764
refactor(start-plugin-core): omit `autoCodeSplitting` configuration o…
SeanCassiere May 21, 2025
6461704
release: v1.121.0-alpha.4
tannerlinsley May 21, 2025
cf9e5bc
fix: buildLocation (#4210)
tannerlinsley May 21, 2025
2b17f15
release: v1.121.0-alpha.5
tannerlinsley May 21, 2025
a5d2740
fix: sitemap support (#4217)
tannerlinsley May 21, 2025
7670d79
release: v1.121.0-alpha.6
tannerlinsley May 21, 2025
b8db2d9
fix: one more test
tannerlinsley May 21, 2025
a769bc9
fix: all tests
tannerlinsley May 21, 2025
8a76fa7
refactor: consistent virtual module naming and resolve using Rollup c…
SeanCassiere May 22, 2025
f06a29b
release: v1.121.0-alpha.7
tannerlinsley May 22, 2025
baf6a52
feat(server-functions-plugin): make the manifest output path configur…
SeanCassiere May 22, 2025
dd34efe
release: v1.121.0-alpha.8
tannerlinsley May 22, 2025
42e075c
fix(start-plugin-core): prepend `/@fs` when a custom client entry is …
yjoer May 22, 2025
fad6b0b
release: v1.121.0-alpha.9
tannerlinsley May 22, 2025
496fac3
fix: make sitemap accessible via public assets (#4235)
SeanCassiere May 23, 2025
bcbd08a
release: v1.121.0-alpha.10
tannerlinsley May 23, 2025
5a3f7ad
fix: better unsafeRelative, support router.navigate() (#4236)
tannerlinsley May 23, 2025
4bdeda8
release: v1.121.0-alpha.11
tannerlinsley May 23, 2025
2fdcca0
Merge branch 'alpha' into plugin-generator-jsdoc
RMHonor May 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 10 additions & 22 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,12 @@
- 'packages/react-router-with-query/**/*'
'package: react-start':
- 'packages/react-start/**/*'
'package: start-api-routes':
- 'packages/start-api-routes/**/*'
'package: react-start-client':
- 'packages/react-start-client/**/*'
'package: react-start-config':
- 'packages/react-start-config/**/*'
'package: react-start-plugin':
- 'packages/react-start-plugin/**/*'
'package: react-start-router-manifest':
- 'packages/react-start-router-manifest/**/*'
'package: react-start-server':
- 'packages/react-start-server/**/*'
'package: start-server-functions-client':
- 'packages/start-server-functions-client/**/*'
'package: start-server-functions-fetcher':
- 'packages/start-server-functions-fetcher/**/*'
'package: start-server-functions-handler':
- 'packages/start-server-functions-handler/**/*'
'package: start-server-functions-ssr':
- 'packages/start-server-functions-ssr/**/*'
'package: router-cli':
- 'packages/router-cli/**/*'
'package: router-core':
Expand All @@ -60,18 +46,20 @@
- 'packages/solid-start/**/*'
'package: solid-start-client':
- 'packages/solid-start-client/**/*'
'package: solid-start-config':
- 'packages/solid-start-config/**/*'
'package: solid-start-plugin':
- 'packages/solid-start-plugin/**/*'
'package: solid-start-router-manifest':
- 'packages/solid-start-router-manifest/**/*'
'package: solid-start-server':
- 'packages/solid-start-server/**/*'
'package: start':
- 'packages/start/**/*'
'package: start-config':
- 'packages/start-config/**/*'
'package: start-client-core':
- 'packages/start-client-core/**/*'
'package: start-plugin-core':
- 'packages/start-plugin-core/**/*'
'package: start-server-core':
- 'packages/start-server-core/**/*'
'package: start-server-functions-client':
- 'packages/start-server-functions-client/**/*'
'package: start-server-functions-fetcher':
- 'packages/start-server-functions-fetcher/**/*'
'package: start-server-functions-server':
- 'packages/start-server-functions-server/**/*'
'package: valibot-adapter':
Expand Down
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,18 @@ nx-cloud.env

gpt/db.json

app.config.timestamp-*
vite.config.timestamp-*
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
app.config.js.timestamp-*
app.config.ts.timestamp-*

app.config.timestamp_*
vite.config.timestamp_*
vite.config.js.timestamp_*
vite.config.ts.timestamp_*
app.config.js.timestamp_*
app.config.ts.timestamp_*

.idea
*.vitest-temp.json

# Handling VSCode settings
/.vscode/
!/examples/react/**/.vscode/settings.json
!/examples/react/**/.vscode/settings.json
**/.tanstack-start/build
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
pnpm-lock.yaml
**/snapshots
**/.vercel
**/.vinxi
**/.output
**/node_modules
node_modules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [React Quer

To run example React projects with Tanstack Router, see [CONTRIBUTING.md](./CONTRIBUTING.md)

<!-- Use the force, Luke!!!! -->
<!-- Use the force, Luke!!! -->
13 changes: 0 additions & 13 deletions docs/router/api/file-based-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,6 @@ By default, this value is set to `false`.
> [!TIP]
> You should ignore the path of your generated route tree file from your linter and formatter to avoid conflicts.

### `apiBase`

As a framework, [TanStack Start](/start) supports the concept of API routes. This option configures the base path for API routes.

By default, this value is set to `/api`.

This means that all API routes will be prefixed with `/api`.

This configuration value is only useful if you are using TanStack Start.

> [!IMPORTANT]
> This default value may conflict with your own project's routing if you planned on having a normal route with the same base path. You can change this value to avoid conflicts.

### `autoCodeSplitting`

This feature is only available is you are using the TanStack Router Bundler Plugin.
Expand Down
4 changes: 2 additions & 2 deletions docs/router/eslint/create-route-property-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Examples of **incorrect** code for this rule:
/* eslint "@tanstack/router/create-route-property-order": "warn" */
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/foo/bar/$id')({
export const Route = createFileRoute({
loader: async ({context}) => {
await context.queryClient.ensureQueryData(getQueryOptions(context.hello)),
},
Expand All @@ -43,7 +43,7 @@ Examples of **correct** code for this rule:
/* eslint "@tanstack/router/create-route-property-order": "warn" */
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/foo/bar/$id')({
export const Route = createFileRoute({
beforeLoad: () => ({hello: 'world'}),
loader: async ({context}) => {
await context.queryClient.ensureQueryData(getQueryOptions(context.hello)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A new function that accepts a single argument of type [`RouteOptions`](./RouteOp
```tsx
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/')({
export const Route = createFileRoute({
loader: () => {
return 'Hello World'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const searchSchema = z.object({
two: z.string().optional(),
})

export const Route = createFileRoute('/hello')({
export const Route = createFileRoute({
validateSearch: zodValidator(searchSchema),
search: {
middlewares: [retainSearchParams(true)],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const searchSchema = z.object({
two: z.string().default(defaultValues.two),
})

export const Route = createFileRoute('/hello')({
export const Route = createFileRoute({
validateSearch: zodValidator(searchSchema),
search: {
// strip default values
Expand Down Expand Up @@ -68,7 +68,7 @@ const searchSchema = z.object({
two: z.string().default('xyz'),
})

export const Route = createFileRoute('/hello')({
export const Route = createFileRoute({
validateSearch: zodValidator(searchSchema),
search: {
// remove all search params
Expand Down
10 changes: 5 additions & 5 deletions docs/router/framework/react/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Before you commit to a new tool, it's always nice to know how it stacks up again
Feature/Capability Key:

- ✅ 1st-class, built-in, and ready to use with no added configuration or code
- 🔵 Supported via addon package
- 🟡 Partial Support (on a scale of 5)
- 🟠 Supported via addon/community package
- 🔶 Possible, but requires custom code/implementation/casting
- 🛑 Not officially supported

Expand Down Expand Up @@ -39,9 +39,9 @@ Feature/Capability Key:
| Ranked Routes | ✅ | ✅ | ✅ |
| Active Link Customization | ✅ | ✅ | ✅ |
| Optimistic UI | ✅ | ✅ | 🔶 |
| Typesafe Absolute + Relative Navigation | ✅ | 🛑 | 🛑 |
| Typesafe Absolute + Relative Navigation | ✅ | 🟡 (1/5 via `buildHref` util) | 🟠 (IDE plugin) |
| Route Mount/Transition/Unmount Events | ✅ | 🛑 | 🛑 |
| Devtools | ✅ | 🛑 | 🛑 |
| Devtools | ✅ | 🟠 | 🛑 |
| Basic Search Params | ✅ | ✅ | ✅ |
| Search Param Hooks | ✅ | ✅ | ✅ |
| `<Link/>`/`useNavigate` Search Param API | ✅ | 🟡 (search-string only via the `to`/`search` options) | 🟡 (search-string only via the `to`/`search` options) |
Expand All @@ -54,7 +54,7 @@ Feature/Capability Key:
| Suspense Route Elements | ✅ | ✅ | ✅ |
| Route Error Elements | ✅ | ✅ | ✅ |
| Route Pending Elements | ✅ | ✅ | ✅ |
| `<Block>`/`useBlocker` | ✅ | 🔶 | ❓ |
| `<Block>`/`useBlocker` | ✅ | 🔶 (no hard reloads or cross-origin navigation) | 🛑 |
| Deferred Primitives | ✅ | ✅ | ✅ |
| Navigation Scroll Restoration | ✅ | ✅ | ❓ |
| ElementScroll Restoration | ✅ | 🛑 | 🛑 |
Expand All @@ -72,7 +72,7 @@ Feature/Capability Key:
| React Server Function Middleware | ✅ | 🛑 | 🛑 |
| API Routes | ✅ | ✅ | ✅ |
| API Middleware | ✅ | 🛑 | ✅ |
| React Server Components | 🛑 | 🛑 | ✅ |
| React Server Components | 🛑 | 🟡 (Experimental) | ✅ |
| `<Form>` API | 🛑 | ✅ | ✅ |

[bp-tanstack-router]: https://badgen.net/bundlephobia/minzip/@tanstack/react-router
Expand Down
2 changes: 1 addition & 1 deletion docs/router/framework/react/decisions-on-dx.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ Let's take a look at how the route configuration for the previous example would
// src/routes/posts/index.ts
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/posts/')({
export const Route = createFileRoute({
component: () => 'Posts index component goes here!!!',
})
```
Expand Down
4 changes: 2 additions & 2 deletions docs/router/framework/react/guide/code-splitting.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ To enable automatic code-splitting, you just need to add the following to the co
// vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
import { tanstackRouter } from '@tanstack/router-plugin/vite'

export default defineConfig({
plugins: [
TanStackRouterVite({
tanstackRouter({
// ...
autoCodeSplitting: true,
}),
Expand Down
6 changes: 3 additions & 3 deletions docs/router/framework/react/guide/external-data-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Here is a naive illustration (don't do this) of using a Route's `loader` option
// src/routes/posts.tsx
let postsCache = []

export const Route = createFileRoute('/posts')({
export const Route = createFileRoute({
loader: async () => {
postsCache = await fetchPosts()
},
Expand Down Expand Up @@ -80,7 +80,7 @@ const postsQueryOptions = queryOptions({
queryFn: () => fetchPosts(),
})

export const Route = createFileRoute('/posts')({
export const Route = createFileRoute({
// Use the `loader` option to ensure that the data is loaded
loader: () => queryClient.ensureQueryData(postsQueryOptions),
component: () => {
Expand All @@ -105,7 +105,7 @@ export const Route = createFileRoute('/posts')({
When an error occurs while using `suspense` with `Tanstack Query`, you'll need to let queries know that you want to try again when re-rendering. This can be done by using the `reset` function provided by the `useQueryErrorResetBoundary` hook. We can invoke this function in an effect as soon as the error component mounts. This will make sure that the query is reset and will try to fetch data again when the route component is rendered again. This will also cover cases where users navigate away from our route instead of clicking the `retry` button.

```tsx
export const Route = createFileRoute('/posts')({
export const Route = createFileRoute({
loader: () => queryClient.ensureQueryData(postsQueryOptions),
errorComponent: ({ error, reset }) => {
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion docs/router/framework/react/guide/not-found-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are 2 uses for not-found errors in TanStack Router:
- Attempting to access `/posts/1/edit` when the route tree only handles `/posts/$postId`
- **Missing resources**: When a resource cannot be found, such as a post with a given ID or any asynchronous data that is not available or does not exist
- **You, the developer** must throw a not-found error when a resource cannot be found. This can be done in the `beforeLoad` or `loader` functions using the `notFound` utility.
- Will be handled by the nearest parent route with a `notFoundComponent` or the root route
- Will be handled by the nearest parent route with a `notFoundComponent` (when `notFound` is called within `loader`) or the root route.
- Examples:
- Attempting to access `/posts/1` when the post with ID 1 does not exist
- Attempting to access `/docs/path/to/document` when the document does not exist
Expand Down
10 changes: 5 additions & 5 deletions docs/router/framework/react/guide/router-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Once you have defined the router context type, you can use it in your route defi

```tsx
// src/routes/todos.tsx
export const Route = createFileRoute('/todos')({
export const Route = createFileRoute({
component: Todos,
loader: ({ context }) => fetchTodosByUserId(context.user.id),
})
Expand Down Expand Up @@ -122,7 +122,7 @@ Then, in your route:

```tsx
// src/routes/todos.tsx
export const Route = createFileRoute('/todos')({
export const Route = createFileRoute({
component: Todos,
loader: ({ context }) => context.fetchTodosByUserId(context.userId),
})
Expand Down Expand Up @@ -158,7 +158,7 @@ Then, in your route:

```tsx
// src/routes/todos.tsx
export const Route = createFileRoute('/todos')({
export const Route = createFileRoute({
component: Todos,
loader: async ({ context }) => {
await context.queryClient.ensureQueryData({
Expand Down Expand Up @@ -234,7 +234,7 @@ So, now in our route's `loader` function, we can access the `networkStrength` ho
```tsx
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/posts')({
export const Route = createFileRoute({
component: Posts,
loader: ({ context }) => {
if (context.networkStrength === 'STRONG') {
Expand Down Expand Up @@ -282,7 +282,7 @@ const router = createRouter({
```tsx
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/todos')({
export const Route = createFileRoute({
component: Todos,
beforeLoad: () => {
return {
Expand Down
4 changes: 2 additions & 2 deletions docs/router/framework/react/guide/scroll-restoration.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ function Component() {

## Scroll Behavior

To control the scroll behavior when navigating between pages, you can use the `scrollBehavior` option. This allows you to make the transition between pages instant instead of a smooth scroll. The global configuration of scroll restoration behavior has the same options as those supported by the browser, which are `smooth`, `instant`, and `auto` (see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#behavior) for more information).
To control the scroll behavior when navigating between pages, you can use the `scrollRestorationBehavior` option. This allows you to make the transition between pages instant instead of a smooth scroll. The global configuration of scroll restoration behavior has the same options as those supported by the browser, which are `smooth`, `instant`, and `auto` (see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView#behavior) for more information).

```tsx
import { createRouter } from '@tanstack/react-router'

const router = createRouter({
scrollBehavior: 'instant',
scrollRestorationBehavior: 'instant',
})
```
Loading