|
Download react-query/docs/framework/react/reference/useQueryErrorResetBoundary.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 715 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/framework/react/reference/useQueryErrorResetBoundary.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/framework/react/reference/useQueryErrorResetBoundary.md
-
curl -L -o useQueryErrorResetBoundary.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/docs/framework/react/reference/useQueryErrorResetBoundary.md
715 Bytes
metadata
id: useQueryErrorResetBoundary
title: useQueryErrorResetBoundary
This hook will reset any query errors within the closest QueryErrorResetBoundary. If there is no boundary defined it will reset them globally:
import { useQueryErrorResetBoundary } from '@tanstack/react-query'
import { ErrorBoundary } from 'react-error-boundary'
const App = () => {
const { reset } = useQueryErrorResetBoundary()
return (
<ErrorBoundary
onReset={reset}
fallbackRender={({ resetErrorBoundary }) => (
<div>
There was an error!
<Button onClick={() => resetErrorBoundary()}>Try again</Button>
</div>
)}
>
<Page />
</ErrorBoundary>
)
}