how to adding custom type in option(queryOptions) select useCustom ?
my use case is to overrides data from api via select options(queryOptions) but i dont know how to adding custom type in useCustom to overrides existing type. according to tkdodo blog (https://tkdodo.eu/blog/react-query-and-type-script) the way to overrides generic type TQueryFnData is adding new type in 3rd generic type called TData = TQueryFnData in useQuery. how can i do to overrides TData from useCustom ? sorry for my bad english
React Query and TypeScript
Combine two of the most powerful tools for React Apps to produce great user experience, developer experience and type safety.
4 Replies
Hey @rdjanuar! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
I understand that you want to override the data type in
useCustom
hook similar to how it's done in useQuery
according to the blog post you mentioned. However, the information extracts provided do not contain any details about overriding the data type specifically for the useCustom
hook in refine.
To get a better understanding of how to work with useCustom
and its options, you can refer to the useCustom documentation (https://refine.dev/docs/api-reference/core/hooks/data/useCustom).
If you still have questions or need further assistance, please provide more information or extracts related to your query.
----------------------<@670249474035286017> kapa.ai is still learning and improving, please let us how it did by reacting below
vicious-gold•2y ago
Hey @rdjanuar,
Good catch! We are currently passing two generic types to
useQuery
, but we should be passing three as you mentioned. Can you open an issue? We'll get it fixed asap. 🚀sensitive-blueOP•2y ago
GitHub
useCustom missing 3rd generic type · Issue #3960 · refinedev/refine
my use case is to overrides data from api via select options(queryOptions) but i dont know how to adding custom type in useCustom to overrides existing type. according to tkdodo blog (https://tkdod...