Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

createRootRoute-ssr-function.tsx

14 lines317 Bytes

1import { createRootRoute } from '@tanstack/react-router'
2import crypto from 'node:crypto'
3​
4export const Route = createRootRoute({
5 ssr: () => {
6 if (crypto.randomInt(0, 2) === 0) {
7 return 'data-only'
8 }
9 return false
10 },
11 component: () => {
12 return <div className="p-2">hello world</div>
13 },
14})