MCPcopy Create free account
hub / github.com/TanStack/devtools / usePosts

Function usePosts

examples/react/basic/src/index.tsx:124–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 </div>
123 )
124}
125function usePosts() {
126 return useQuery({
127 queryKey: ['posts'],
128 queryFn: async (): Promise<Array<Post>> => {
129 const response = await fetch('https://jsonplaceholder.typicode.com/posts')
130 return await response.json()
131 },
132 })
133}
134
135const Context = createContext<{

Callers 1

PostsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected