Open History to see the last commit
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`