MCPcopy Create free account
hub / github.com/TanStack/query / App

Function App

integrations/react/vite/src/App.tsx:3–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { useQuery } from '@tanstack/react-query'
2
3const App = () => {
4 const query = useQuery({
5 queryKey: ['test'],
6 queryFn: async () => {
7 await new Promise((r) => setTimeout(r, 1000))
8 return 'Success'
9 },
10 })
11
12 if (query.isPending) {
13 return <div>Loading...</div>
14 }
15
16 if (query.isError) {
17 return <div>An error has occurred!</div>
18 }
19
20 return <div>{query.data}</div>
21}
22
23export default App

Callers

nothing calls this directly

Calls 1

useQueryFunction · 0.90

Tested by

no test coverage detected