Capítulo 70 de 80

Chapter 70: useSuspenseInfiniteQuery

Core Idea

The Suspense variant of useInfiniteQuery, with the same option removals and guarantees as useSuspenseQuery (no throwOnError/enabled/placeholderData; data always defined; cancellation doesn't work) layered on top of the infinite-query shape.

Key Concepts

  • Options: identical to useInfiniteQuery minus throwOnError, enabled, placeholderData.
  • Returns: identical to useInfiniteQuery (data.pages/data.pageParams, fetchNextPage/fetchPreviousPage, hasNextPage/hasPreviousPage, etc.) except data is guaranteed defined, isPlaceholderData doesn't exist, and status only reports 'success' | 'error'.
  • Caveat: cancellation doesn't work here either.

Key Takeaways

  1. Combine with useSuspenseQueries (not multiple standalone Suspense hooks) whenever more than one lives in the same component, to avoid the serial-fetch pitfall covered in Performance & Request Waterfalls.

Connects To

  • useInfiniteQuery: the full option/return reference this variant is built on.
  • Suspense: the shared trade-offs (no enabled, no placeholderData, no cancellation).