MCPcopy Create free account
hub / github.com/TanStack/router / RootComponent

Function RootComponent

examples/react/basic-react-query/src/main.tsx:39–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37})
38
39function RootComponent() {
40 return (
41 <>
42 <div className="p-2 flex gap-2 text-lg">
43 <Link
44 to="/"
45 activeProps={{
46 className: 'font-bold',
47 }}
48 activeOptions={{ exact: true }}
49 >
50 Home
51 </Link>{' '}
52 <Link
53 to="/posts"
54 activeProps={{
55 className: 'font-bold',
56 }}
57 >
58 Posts
59 </Link>{' '}
60 <Link
61 to="/route-a"
62 activeProps={{
63 className: 'font-bold',
64 }}
65 >
66 Pathless Layout
67 </Link>{' '}
68 <Link
69 // @ts-expect-error
70 to="/this-route-does-not-exist"
71 activeProps={{
72 className: 'font-bold',
73 }}
74 >
75 This Route Does Not Exist
76 </Link>
77 </div>
78 <hr />
79 <Outlet />
80 <ReactQueryDevtools buttonPosition="top-right" />
81 <TanStackRouterDevtools position="bottom-right" />
82 </>
83 )
84}
85
86const indexRoute = createRoute({
87 getParentRoute: () => rootRoute,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected