QueryOptions return type
I want to create a Link component that handles routing but also want to prefetch data if the user hovers that link.
I already make use of the queryOptions api so i created this factory
I want to make a component like this
so you could use it like:
However, i cant get to type to work correctly for the prefetch prop.
4 Replies
deep-jadeOP•2y ago
For now it seems
UseQueriesOptions<any>
would be working.rival-black•2y ago
I think you need to type the props as
Then you can only pass in whatever the return type of get and getInitial are
deep-jadeOP•2y ago
Thanks for your answer but I will be creating a lot more query options so adding them all there not really be helpful.
rival-black•2y ago
Then it might be easier for you to do an Exclude on
clientQueries
to remove all the ones you don't want