Convenience wrapper that combines <Suspense> and QueryErrorBoundary in the correct order.
<Suspense>
<QueryBoundary loadingFallback={<Spinner />} onError={({ isQueryUnauthorized, reset }) => isQueryUnauthorized ? <p>Not authorized. <button onClick={reset}>Retry</button></p> : <p>Something went wrong. <button onClick={reset}>Retry</button></p> }> <ItemList /></QueryBoundary> Copy
<QueryBoundary loadingFallback={<Spinner />} onError={({ isQueryUnauthorized, reset }) => isQueryUnauthorized ? <p>Not authorized. <button onClick={reset}>Retry</button></p> : <p>Something went wrong. <button onClick={reset}>Retry</button></p> }> <ItemList /></QueryBoundary>
QueryBoundary passes all remaining props to QueryErrorBoundary. The fallback prop is forwarded to QueryErrorBoundary (error fallback), while loadingFallback is forwarded to <Suspense> (loading state).
QueryBoundary
fallback
QueryErrorBoundary
loadingFallback
Convenience wrapper that combines
<Suspense>and QueryErrorBoundary in the correct order.QueryBoundarypasses all remaining props to QueryErrorBoundary. Thefallbackprop is forwarded toQueryErrorBoundary(error fallback), whileloadingFallbackis forwarded to<Suspense>(loading state).