Open History to see the last commit
TanStack Solid Query Simple Example#
Fetches a single GitHub repository and shows its stats.
How it works#
src/index.tsxcreates aQueryClientand provides it to the app withQueryClientProvider.- The
Examplecomponent callsuseQuerywith an inlinequeryKey: ['repoData']and aqueryFnthat fetches theTanStack/queryrepository from the GitHub API. - It renders the loading state from
isPending, the error fromerror, and the repository stats fromdata, and shows "Updating..." whileisFetchingistrue.
To run this example:
npm installnpm run dev