Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

README.md

14 lines595 Bytes

1# TanStack Solid Query Simple Example
2​
3Fetches a single GitHub repository and shows its stats.
4​
5## How it works
6​
7- `src/index.tsx` creates a `QueryClient` and provides it to the app with `QueryClientProvider`.
8- The `Example` component calls `useQuery` with an inline `queryKey: ['repoData']` and a `queryFn` that fetches the `TanStack/query` repository from the GitHub API.
9- It renders the loading state from `isPending`, the error from `error`, and the repository stats from `data`, and shows "Updating..." while `isFetching` is `true`.
10​
11To run this example:
12​
13- `npm install`
14- `npm run dev`