Arc.React
    Preparing search index...

    Class QueryErrorBoundary

    A class-based error boundary that catches errors thrown by useSuspenseQuery and useSuspenseObservableQuery — specifically QueryFailed and QueryUnauthorized.

    Place it around any subtree that uses Suspense query hooks:

    <QueryErrorBoundary onError={({ error, isQueryFailed, reset }) =>
    <div>
    <p>{isQueryFailed ? 'Server error' : 'Not authorized'}</p>
    <button onClick={reset}>Retry</button>
    </div>
    }>
    <Suspense fallback={<Spinner />}>
    <MyComponent />
    </Suspense>
    </QueryErrorBoundary>

    Hierarchy

    Index

    Constructors

    Methods

    • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

      Parameters

      • error: Error
      • info: ErrorInfo

      Returns void