# ReactQuery Example **Published by:** [GreatWeb3Frontend](https://paragraph.com/@greatweb3frontend/) **Published on:** 2025-08-09 **URL:** https://paragraph.com/@greatweb3frontend/reactquery-example ## Content import { QueryClient, QueryClientProvider, useQuery, } from '@tanstack/react-query' const queryClient = new QueryClient() export default function App() { return ( <QueryClientProvider client={queryClient}> <Example /> </QueryClientProvider> ) } function Example() { const { isPending, error, data } = useQuery({ queryKey: ['repoData'], queryFn: () => fetch('https://api.github.com/repos/TanStack/query').then((res) => res.json(), ), }) if (isPending) return 'Loading...' if (error) return 'An error has occurred: ' + error.message return ( <div> <h1>{data.name}</h1> <p>{data.description}</p> <strong>👀 {data.subscribers_count}</strong>{' '} <strong>✨ {data.stargazers_count}</strong>{' '} <strong>🍴 {data.forks_count}</strong> </div> ) } ## Publication Information - [GreatWeb3Frontend](https://paragraph.com/@greatweb3frontend/): Publication homepage - [All Posts](https://paragraph.com/@greatweb3frontend/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@greatweb3frontend): Subscribe to updates