-
- {virtualizer.getVirtualItems().map(virtualRow => (
-
- ))}
-
-
- )
-}
-```
-
-**Benefits:**
-
-- Handle thousands of items
-- Constant performance regardless of list size
-- Better UX
-
-#### 8.4 Optimize TanStack Query Configuration
-
-**Effort:** Low | **Priority:** Medium | **Impact:** Medium
-
-```typescript
-// app/root.tsx
-const queryClient = new QueryClient({
- defaultOptions: {
- queries: {
- staleTime: 1000 * 60 * 5, // 5 minutes
- gcTime: 1000 * 60 * 10, // 10 minutes (was cacheTime)
- retry: 1,
- refetchOnWindowFocus: false, // Prevent unnecessary refetches
- refetchOnReconnect: true,
- },
- mutations: {
- retry: 0,
- onError: (error) => {
- // Global error handling
- console.error('Mutation error:', error)
- },
- },
- },
-})
-```
-
-**Add prefetching:**
-
-```typescript
-// app/routes/home.tsx
-import { useQueryClient } from '@tanstack/react-query'
-
-export default function Home() {
- const queryClient = useQueryClient()
- const { data: acquisitions } = useGetAcquisitionsAcquisitionsGet()
-
- const handleRowHover = (acqId: string) => {
- // Prefetch grids data
- queryClient.prefetchQuery({
- queryKey: getGetAcquisitionGridsQueryKey(acqId),
- queryFn: () => getAcquisitionGrids(acqId)
- })
- }
-
- return (
-