examples/preact/simple
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack Preact Query Simple Example#
Fetches a single GitHub repository and shows its stats.
How it works#
src/index.tsxcreates aQueryClientand provides it withQueryClientProvider.Examplein the same file callsuseQuerywithqueryKey: ['repoData']and an inlinequeryFnthat fetches the TanStack Query repository from the GitHub API.- It shows "Loading..." while
isPendingistrue, the error message whenerroris set, and "Updating..." whileisFetchingistrueduring a background refetch.
To run this example:
npm installnpm run dev