Skip to content

Commit

Permalink
docs(start): fix createRouter call (#3290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikachews authored Jan 31, 2025
1 parent d90d517 commit 74afefe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docs/start/framework/react/build-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ import { routeTree } from './routeTree.gen'
export function createRouter() {
const router = createTanStackRouter({
routeTree,
scrollRestoration: true,
})

return router
Expand Down Expand Up @@ -190,9 +191,7 @@ import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { createRouter } from './router'

const router = createRouter({
scrollRestoration: true,
})
const router = createRouter()

hydrateRoot(document, <StartClient router={router} />)
```
Expand Down
4 changes: 1 addition & 3 deletions docs/start/framework/react/learn-the-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ import { hydrateRoot } from 'react-dom/client'
import { StartClient } from '@tanstack/start'
import { createRouter } from './router'

const router = createRouter({
scrollRestoration: true,
})
const router = createRouter()

hydrateRoot(document, <StartClient router={router} />)
```
Expand Down

0 comments on commit 74afefe

Please sign in to comment.