MCPcopy 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
91function usePost(postId: number) {
92 return useQuery({
93 queryKey: ['post', postId],
94 queryFn: () => getPostById(postId),
95 enabled: !!postId,
96 })
97}
98
99function Post({
100 postId,

Callers 1

PostFunction · 0.70

Calls 2

useQueryFunction · 0.90
getPostByIdFunction · 0.70

Tested by

no test coverage detected