useQueryErrorResetBoundary
TheuseQueryErrorResetBoundary hook provides access to the nearest QueryErrorResetBoundary context. It returns methods to reset queries and manage error boundary state.
Import
Signature
Returns
() => void
Call this function to reset all queries within the boundary and trigger error boundary reset
() => void
Manually clear the reset flag (usually handled automatically)
() => boolean
Check if the boundary is currently in reset state
Examples
Basic Usage
Custom Retry Button
Checking Reset State
With Loading State
Multiple Reset Actions
Conditional Reset
Notes
- Must be used within a
QueryErrorResetBoundarycomponent - The
reset()function triggers all queries within the boundary to retry - Commonly used in Error Boundary fallback components
- The reset state is automatically cleared after queries have retried
- Can be called multiple times safely
- Works with nested boundaries - only affects queries within the nearest boundary