Skip to content

Commit 74afefe

Browse files
authoredJan 31, 2025
docs(start): fix createRouter call (#3290)
1 parent d90d517 commit 74afefe

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed
 

‎docs/start/framework/react/build-from-scratch.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ import { routeTree } from './routeTree.gen'
140140
export function createRouter() {
141141
const router = createTanStackRouter({
142142
routeTree,
143+
scrollRestoration: true,
143144
})
144145

145146
return router
@@ -190,9 +191,7 @@ import { hydrateRoot } from 'react-dom/client'
190191
import { StartClient } from '@tanstack/start'
191192
import { createRouter } from './router'
192193

193-
const router = createRouter({
194-
scrollRestoration: true,
195-
})
194+
const router = createRouter()
196195

197196
hydrateRoot(document, <StartClient router={router} />)
198197
```

‎docs/start/framework/react/learn-the-basics.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ import { hydrateRoot } from 'react-dom/client'
8585
import { StartClient } from '@tanstack/start'
8686
import { createRouter } from './router'
8787

88-
const router = createRouter({
89-
scrollRestoration: true,
90-
})
88+
const router = createRouter()
9189

9290
hydrateRoot(document, <StartClient router={router} />)
9391
```

0 commit comments

Comments
 (0)