Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TanStack/devtools
/ usePost
Function
usePost
examples/react/basic/src/index.tsx:84–90 ·
view source on GitHub ↗
(postId: number)
Source
from the content-addressed store, hash-verified
82
)
83
return await response.json()
84
}
85
86
function usePost(postId: number) {
87
return useQuery({
88
queryKey: [
'post'
, postId],
89
queryFn: () => getPostById(postId),
90
enabled: !!postId,
91
})
92
}
93
Callers
1
Post
Function · 0.70
Calls
1
getPostById
Function · 0.70
Tested by
no test coverage detected