Where did useUtils go?
I am working through upgrading my project and I use
useUtils
here and there to do fetches from components like ag-grid which requires a data source
It looks something like this
I thought it had moved to something under getting the trpc using the useTRPC
but it doesn't seem to be there, how should I get this to work?4 Replies
I am using these versions
I believe the syntax has changed a couple of months ago. It works for me as follows:
yeah that is what i thought too, it wasnt showing up. Let me try again
yeah it is missing for me
I have
I have tried looking at the return of the
createTRPCContext
and it is not there , it is coming from the import
useUtils
is just a wrapper around Tanstack Query. See https://trpc.io/docs/client/react/useUtils#helpers
The new integration uses native Tanstack Query, removing the wrappers. For your case (the fetch call) I believe you must change your code to: