'use client'; import * as React from 'react'; import { shouldThrowError } from './utils.mjs'; const ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => { if (options.suspense || options.useErrorBoundary) { // Prevent retrying failed query if the error boundary has not been reset yet if (!errorResetBoundary.isReset()) { options.retryOnMount = false; } } }; const useClearResetErrorBoundary = errorResetBoundary => { React.useEffect(() => { errorResetBoundary.clearReset(); }, [errorResetBoundary]); }; const getHasError = ({ result, errorResetBoundary, useErrorBoundary, query }) => { return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(useErrorBoundary, [result.error, query]); }; export { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundary }; //# sourceMappingURL=errorBoundaryUtils.mjs.map