File tree Expand file tree Collapse file tree
apps/web/components/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"use client" ;
22
33import { type ReactNode , type ComponentType } from "react" ;
4+ import { QueryErrorResetBoundary } from "@tanstack/react-query" ;
45import { ErrorBoundary , type FallbackProps } from "react-error-boundary" ;
56
67interface ErrorResetBoundaryProps {
@@ -12,5 +13,13 @@ export default function ErrorResetBoundary({
1213 children,
1314 fallbackComponent : FallbackComponent ,
1415} : ErrorResetBoundaryProps ) : JSX . Element {
15- return < ErrorBoundary FallbackComponent = { FallbackComponent } > { children } </ ErrorBoundary > ;
16+ return (
17+ < QueryErrorResetBoundary >
18+ { ( { reset } ) => (
19+ < ErrorBoundary onReset = { reset } FallbackComponent = { FallbackComponent } >
20+ { children }
21+ </ ErrorBoundary >
22+ ) }
23+ </ QueryErrorResetBoundary >
24+ ) ;
1625}
Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Button } from "@ui/index" ;
4- import { getQueryClient } from "@/lib/queryClient" ;
54
65interface ErrorFallbackProps {
76 error : Error ;
87 resetErrorBoundary : ( ) => void ;
98}
109
1110export default function ErrorFallback ( { resetErrorBoundary } : ErrorFallbackProps ) : JSX . Element {
12- const queryClient = getQueryClient ( ) ;
13-
1411 const handleResetErrorBoundary = ( ) : void => {
15- queryClient . removeQueries ( ) ;
1612 resetErrorBoundary ( ) ;
1713 } ;
1814
You can’t perform that action at this time.
0 commit comments