Frontend & UISûr100100/100
With Tanstack Query (TanStack) — Preact Table
Compose native Preact Table v9 with @tanstack/preact-query using table state in query keys, manual server filtering/sorting/pagination, server counts, and stable query-result data. Load when React Query examples or manual* expectations are wrong for Preact.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs with-tanstack-query__tanstack-table__packages-preact-table-skills-ad5dd8fa275eTanStack
TanStack/table
Contenu à copier
---
name: with-tanstack-query
description: >
Compose native Preact Table v9 with @tanstack/preact-query using table state in query keys, manual server filtering/sorting/pagination, server counts, and stable query-result data. Load when React Query examples or manual* expectations are wrong for Preact.
metadata:
origin: TanStack
{
type: composition,
library: '@tanstack/preact-table',
library_version: '9.2.4',
framework: preact,
}
requires:
['@tanstack/table-core#client-vs-server', getting-started, table-state]
sources:
- 'TanStack/table:examples/preact/with-tanstack-query'
- 'TanStack/table:docs/framework/preact/guide/pagination.md'
---
This skill builds on `@tanstack/table-core#client-vs-server`, `getting-started`, and `table-state`. Query fetches already processed rows; Table's manual flags only declare that boundary.
## Setup
```tsx
import { keepPreviousData, useQuery } from '@tanstack/preact-query'
import { useCreateAtom, useSelector } from '@tanstack/preact-store'
import {
rowPaginationFeature,
tableFeatures,
useTable,
} from '@tanstack/preact-table'
const features = tableFeatures({ rowPaginationFeature })
const emptyRows: Array<{ id: string }> = []
const paginationAtom = useCreateAtom({ pageIndex: 0, pageSize: 20 })
const pagination = useSelector(paginationAtom, (value) => value)
const result = useQuery({
queryKey: ['people', pagination],
queryFn: () => fetchPeople(pagination),
placeholderData: keepPreviousData,
})
const table = useTable({
features,
columns,
data: result.data?.rows ?? emptyRows,
rowCount: result.data?.rowCount,
atoms: { pagination: paginationAtom },
manualPagination: true,
})
```
## Core Patterns
### Key requests by every server-owned slice
```tsx
useQuery({
queryKey: ['people', pagination, sorting],
queryFn: () => fetchPeople({ pagination, sorting }),
})
```
### Pass cached rows directly
```tsx
useTable({ features, columns, data: result.data?.rows ?? emptyRows })
```
## Common Mistakes
### HIGH Importing React Query APIs
Wrong:
```tsx
import { useQuery } from '@tanstack/react-query'
```
Correct:
```tsx
import { useQuery } from '@tanstack/preact-query'
```
Use native Preact Query and Store integrations throughout the composition.
Source: `examples/preact/with-tanstack-query`
### HIGH Reusing one cache key
Wrong:
```tsx
useQuery({ queryKey: ['people'], queryFn: () => fetchPeople(pagination) })
```
Correct:
```tsx
useQuery({
queryKey: ['people', pagination],
queryFn: () => fetchPeople(pagination),
})
```
Each processed server result needs a key that includes its request state.
Source: `examples/preact/with-tanstack-query`
### HIGH Expecting manual flags to fetch
Wrong:
```tsx
useTable({ features, columns, data, manualPagination: true })
```
Correct:
```tsx
useTable({
features,
columns,
data: result.data?.rows ?? emptyRows,
rowCount: result.data?.rowCount,
manualPagination: true,
})
```
Manual pagination bypasses local processing; it neither calls the backend nor invents totals.
Source: `docs/framework/preact/guide/pagination.md`
## API Discovery
Inspect installed `node_modules/@tanstack/preact-table/dist/index.d.ts` and the relevant core feature source; inspect `@tanstack/preact-query` source for exact query APIs.Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait With Tanstack Query (TanStack) — Preact Table
Applique les pratiques du skill with-tanstack-query__tanstack-table__packages-preact-table-skills-ad5dd8fa275e.
Comment utiliser With Tanstack Query (TanStack) — Preact Table
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour With Tanstack Query (TanStack) — Preact Table
Dis simplement à ton agent quelque chose comme :
Applique le skill with-tanstack-query__tanstack-table__packages-preact-table-skills-ad5dd8fa275e à cette tâche
Utilise with-tanstack-query__tanstack-table__packages-preact-table-skills-ad5dd8fa275e pour améliorer cette implémentation
Passe en revue ce sujet avec with-tanstack-query__tanstack-table__packages-preact-table-skills-ad5dd8fa275e
Skills liés à With Tanstack Query (TanStack) — Preact Table
accessibility
Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels, accessibility traits and hints, focus management, contrast, target size, and screen-reader support. Use when building or auditing UI for accessibility compliance, keyboard navigation, or screen-reader support.Accessibility Pass (Microsoft)
Use this skill whenever the user asks to check, review, or fix the accessibility of a PowerPoint deck, Word document, HTML page, or Markdown file, and before handing over any deck or document this agent just generated, so it does not ship with missing alt text, untitled slides, or unreadable colour contrast.Add Connector (Microsoft)
Use when adding a Power Platform connector to an Expo/React Native Power Apps mobile app and no dedicated mobile connector skill exists.