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

index.tsx

37 lines1.2 KB

1import * as React from 'react'
2import { Link, createFileRoute } from '@tanstack/react-router'
3​
4export const Route = createFileRoute('/')({
5 component: IndexComponent,
6})
7​
8function IndexComponent() {
9 return (
10 <div className={`p-2`}>
11 <div className={`text-lg`}>Welcome Home!</div>
12 <hr className={`my-2`} />
13 <Link
14 to="/dashboard/posts/$postId"
15 params={{
16 postId: '3',
17 }}
18 className={`py-1 px-2 text-xs bg-blue-500 text-white rounded-full`}
19 >
20 1 New Invoice
21 </Link>
22 <hr className={`my-2`} />
23 <div className={`max-w-xl`}>
24 As you navigate around take note of the UX. It should feel
25 suspense-like, where routes are only rendered once all of their data and
26 elements are ready.
27 <hr className={`my-2`} />
28 To exaggerate async effects, play with the artificial request delay
29 slider in the bottom-left corner.
30 <hr className={`my-2`} />
31 The last 2 sliders determine if link-hover preloading is enabled (and
32 how long those preloads stick around) and also whether to cache rendered
33 route data (and for how long). Both of these default to 0 (or off).
34 </div>
35 </div>
36 )