Skip to content

Commit cc7a99f

Browse files
try manual wrap, no difference
1 parent a54628b commit cc7a99f

File tree

1 file changed

+13
-3
lines changed
  • examples/react/react-start/src/routes

1 file changed

+13
-3
lines changed

examples/react/react-start/src/routes/index.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
import { Link, createFileRoute } from '@tanstack/react-router'
22
import { useSuspenseQuery } from '@tanstack/react-query'
3+
import { Suspense } from 'react'
34
import { projectsQuery } from '../utils/queries'
45
import Spinner from '../components/Spinner'
56

67
export const Route = createFileRoute('/')({
7-
component: ProjectsComponent,
8-
pendingComponent: () => <div>Loading projects...</div>,
8+
component: RouteComponent,
9+
// pendingComponent: () => <div>Loading projects...</div>,
10+
wrapInSuspense: false
911
})
1012

13+
function RouteComponent() {
14+
return (
15+
<Suspense fallback={<div>Loading projects...</div>}>
16+
<ProjectsComponent />
17+
</Suspense>
18+
)
19+
}
20+
1121
function ProjectsComponent() {
1222
const { data, isFetching } = useSuspenseQuery(projectsQuery())
1323

1424
return (
1525
<div>
1626
<h1>TanStack Repositories {isFetching ? <Spinner /> : null}</h1>
17-
<Link to='/'>Back</Link>
27+
<Link to="/">Back</Link>
1828
{data.map((project) => (
1929
<p key={project.full_name}>
2030
<Link

0 commit comments

Comments
 (0)