Running a query function without useQuery
I have the following query function. How can I run this outside of a React component (e.g. loader function of a route from TanStack Router), so that it still gets cached as if evoked through
useQuery hook?
3 Replies
adverse-sapphire•16mo ago
queryClient.prefetchQueryrare-sapphireOP•16mo ago
I believe this should be the
queryClient instance passed to QueryClientProvider, right?adverse-sapphire•16mo ago
yes