Skip to content

Commit

Permalink
feat(react-query): export QueryErrorResetBoundaryFunction
Browse files Browse the repository at this point in the history
Export the QueryErrorResetBoundaryFunction render prop function
signature so users don't have to write wierd types of there own
  • Loading branch information
DogPawHat committed Sep 23, 2024
1 parent 9da00d6 commit 8e7928c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/react-query/src/QueryErrorResetBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export const useQueryErrorResetBoundary = () =>

// COMPONENT

export type QueryErrorResetBoundaryFunction = (
value: QueryErrorResetBoundaryValue,
) => React.ReactNode

export interface QueryErrorResetBoundaryProps {
children:
| ((value: QueryErrorResetBoundaryValue) => React.ReactNode)
| React.ReactNode
children: QueryErrorResetBoundaryFunction | React.ReactNode
}

export const QueryErrorResetBoundary = ({
Expand All @@ -45,9 +47,7 @@ export const QueryErrorResetBoundary = ({
const [value] = React.useState(() => createValue())
return (
<QueryErrorResetBoundaryContext.Provider value={value}>
{typeof children === 'function'
? (children as Function)(value)
: children}
{typeof children === 'function' ? children(value) : children}
</QueryErrorResetBoundaryContext.Provider>
)
}

0 comments on commit 8e7928c

Please sign in to comment.