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
return await response.json()
83
}
84
85
function usePost(postId: number) {
86
return useQuery({
87
queryKey: [
'post'
, postId],
88
queryFn: () => getPostById(postId),
89
enabled: !!postId,
90
})
91
}
92
93
function Post({
Callers
1
Post
Function · 0.70
Calls
1
getPostById
Function · 0.70
Tested by
no test coverage detected