useReadErrorReset
The reset handle of the nearest ReadErrorResetBoundary, or of the whole app without one. Signature, result and examples for useReadErrorReset.
Read hookstable
Since v1.0.0View source
The reset handle of the nearest ReadErrorResetBoundary, or of the whole app without
one. Call reset from an error boundary's reset callback so useSuspenseRead reads again.
Signature
function useReadErrorReset(): ReadErrorResetExamples
import { useReadErrorReset } from "@ensforge/react"
export function RetryButton({ onRetry }: { onRetry: () => void }) {
const { reset } = useReadErrorReset()
return <button onClick={() => { reset(); onRetry() }}>Try again</button>
}See also
- The hook types:
ReadResult,WriteResultandReadConfig.
Was this page helpful?