Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1402,89 +1402,85 @@
{
"label": "preact",
"children": [
{
"label": "Preact Reference",
"to": "framework/preact/reference/index"
},
{
"label": "useQuery",
"to": "framework/preact/reference/functions/useQuery"
"to": "framework/preact/reference/useQuery"
},
{
"label": "useQueries",
"to": "framework/preact/reference/functions/useQueries"
"to": "framework/preact/reference/useQueries"
},
{
"label": "useInfiniteQuery",
"to": "framework/preact/reference/functions/useInfiniteQuery"
"to": "framework/preact/reference/useInfiniteQuery"
},
{
"label": "useMutation",
"to": "framework/preact/reference/functions/useMutation"
"to": "framework/preact/reference/useMutation"
},
{
"label": "useIsFetching",
"to": "framework/preact/reference/functions/useIsFetching"
"to": "framework/preact/reference/useIsFetching"
},
{
"label": "useIsMutating",
"to": "framework/preact/reference/functions/useIsMutating"
"to": "framework/preact/reference/useIsMutating"
},
{
"label": "useMutationState",
"to": "framework/preact/reference/functions/useMutationState"
"to": "framework/preact/reference/useMutationState"
},
{
"label": "useSuspenseQuery",
"to": "framework/preact/reference/functions/useSuspenseQuery"
"to": "framework/preact/reference/useSuspenseQuery"
},
{
"label": "useSuspenseInfiniteQuery",
"to": "framework/preact/reference/functions/useSuspenseInfiniteQuery"
"to": "framework/preact/reference/useSuspenseInfiniteQuery"
},
{
"label": "useSuspenseQueries",
"to": "framework/preact/reference/functions/useSuspenseQueries"
"to": "framework/preact/reference/useSuspenseQueries"
},
{
"label": "QueryClientProvider",
"to": "framework/preact/reference/functions/QueryClientProvider"
"to": "framework/preact/reference/QueryClientProvider"
},
{
"label": "useQueryClient",
"to": "framework/preact/reference/functions/useQueryClient"
"to": "framework/preact/reference/useQueryClient"
},
{
"label": "queryOptions",
"to": "framework/preact/reference/functions/queryOptions"
"to": "framework/preact/reference/queryOptions"
},
{
"label": "infiniteQueryOptions",
"to": "framework/preact/reference/functions/infiniteQueryOptions"
"to": "framework/preact/reference/infiniteQueryOptions"
},
{
"label": "mutationOptions",
"to": "framework/preact/reference/functions/mutationOptions"
"to": "framework/preact/reference/mutationOptions"
},
{
"label": "usePrefetchQuery",
"to": "framework/preact/reference/functions/usePrefetchQuery"
"to": "framework/preact/reference/usePrefetchQuery"
},
{
"label": "usePrefetchInfiniteQuery",
"to": "framework/preact/reference/functions/usePrefetchInfiniteQuery"
"to": "framework/preact/reference/usePrefetchInfiniteQuery"
},
{
"label": "QueryErrorResetBoundary",
"to": "framework/preact/reference/functions/QueryErrorResetBoundary"
"to": "framework/preact/reference/QueryErrorResetBoundary"
},
{
"label": "useQueryErrorResetBoundary",
"to": "framework/preact/reference/functions/useQueryErrorResetBoundary"
"to": "framework/preact/reference/useQueryErrorResetBoundary"
},
{
"label": "hydration",
"to": "framework/preact/reference/functions/HydrationBoundary"
"to": "framework/preact/reference/hydration"
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions docs/framework/preact/reference/QueryClientProvider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
id: QueryClientProvider
title: QueryClientProvider
ref: docs/framework/react/reference/QueryClientProvider.md
replace: { '@tanstack/react-query': '@tanstack/preact-query' }
---
50 changes: 50 additions & 0 deletions docs/framework/preact/reference/QueryErrorResetBoundary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: QueryErrorResetBoundary
title: QueryErrorResetBoundary
ref: docs/framework/react/reference/QueryErrorResetBoundary.md
replace: { '@tanstack/react-query': '@tanstack/preact-query' }
---

[//]: # 'ReactErrorBoundaryExample'

Preact provides a [`useErrorBoundary` hook](https://preactjs.com/guide/v10/hooks/#useerrorboundary) that you can combine with `QueryErrorResetBoundary`'s `reset`:

```tsx
import { QueryErrorResetBoundary } from '@tanstack/preact-query'
import type { ComponentChildren } from 'preact'
import { useErrorBoundary } from 'preact/hooks'

function ErrorBoundary(props: { onReset: () => void; children: ComponentChildren }) {
const [error, resetError] = useErrorBoundary()

if (error) {
return (
<div>
There was an error!
<Button
onClick={() => {
props.onReset()
resetError()
}}
>
Try again
</Button>
</div>
)
}

return props.children
}

const App = () => (
<QueryErrorResetBoundary>
{({ reset }) => (
<ErrorBoundary onReset={reset}>
<Page />
</ErrorBoundary>
)}
</QueryErrorResetBoundary>
)
```

[//]: # 'ReactErrorBoundaryExample'
20 changes: 0 additions & 20 deletions docs/framework/preact/reference/functions/HydrationBoundary.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/framework/preact/reference/functions/QueryClientProvider.md

This file was deleted.

This file was deleted.

124 changes: 0 additions & 124 deletions docs/framework/preact/reference/functions/infiniteQueryOptions.md

This file was deleted.

Loading
Loading