How to type pageParam in useInfiniteQuery hook?
I was wondering what's the suggested way to type
pageParam in useInfiniteQuery hook?
I'm doing it currently this way, but maybe there's a better way:
3 Replies
quickest-silver•4y ago
you can use the type
QueryFunctionContext. First generic is the queryKey, second one is pageParam
quickest-silver•4y ago
GitHub
query/types.ts at 07c96311a50a2aa45f516fa2c153ce68ca8f1a9b · TanSta...
🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. - query/types.ts at 07c96311a50a2aa45f516fa2c153ce68ca8f1a9b · TanStack/q...
sensitive-blueOP•4y ago
Thank you so much!