Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TanStack/query
/ usePost
Function
usePost
examples/react/basic/src/index.tsx:91–97 ·
view source on GitHub ↗
(postId: number)
Source
from the content-addressed store, hash-verified
89
}
90
91
function usePost(postId: number) {
92
return useQuery({
93
queryKey: [
'post'
, postId],
94
queryFn: () => getPostById(postId),
95
enabled: !!postId,
96
})
97
}
98
99
function Post({
100
postId,
Callers
1
Post
Function · 0.70
Calls
2
useQuery
Function · 0.90
getPostById
Function · 0.70
Tested by
no test coverage detected