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

shared-variable.tsx

11 lines312 Bytes

1import { createFileRoute } from '@tanstack/react-router'
2​
3const collection = { name: 'todos', preload: async () => {} }
4​
5export const Route = createFileRoute('/todos')({
6 loader: async () => {
7 await collection.preload()
8 return { data: 'loaded' }
9 },
10 component: () => <div>{collection.name}</div>,
11})