React hook and component to reset query errors within a boundary for TanStack Query.
// Source: https://github.com/TanStack/query | License: MIT | Copyright 2021-present Tanner Linsley // Provided via justclaw.it.com; keep this notice with the code. 'use client' import * as React from 'react' // CONTEXT /** * Resets any query errors within the boundary, so queries know they can try again. */ export type QueryErrorResetFunction = () => void /** * Returns whether the boundary has been reset and not yet cleared. */ export type QueryErrorIsResetFunction = () => boolean /** * Clears the reset state, so queries know not to try again until the boundary is reset again. */ export type QueryErrorClearResetFunction = () => void /** * The value a `QueryErrorResetBoundary` shares through context, used to reset query errors within * it and to check whether a reset was reque ... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key