Skip to content

Commit 1201f32

Browse files
committed
checkpoint
1 parent 677888d commit 1201f32

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/blog/composite-components.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ Streams are universal. They work with:
162162
- **TanStack Query** → Cache server components, refetch in the background, deduplicate requests
163163
- **TanStack DB** (coming soon) → Sync server component state, offline support, optimistic updates
164164

165+
### In a route loader
166+
165167
```tsx
166-
// In a route loader
167168
export const Route = createFileRoute('/posts/$postId')({
168169
loader: async ({ params }) => ({
169170
Post: await getPost({ data: { postId: params.postId } }),
@@ -182,8 +183,9 @@ function PostPage() {
182183
}
183184
```
184185

186+
### With Query caching
187+
185188
```tsx
186-
// With Query caching
187189
const { data: Layout } = useQuery({
188190
queryKey: ['layout'],
189191
queryFn: () => getLayout(),

0 commit comments

Comments
 (0)