How to access hooks while initializating react query client for nextJS?
Usually when initialing react query client this happens in the react component scope. Considering we are not using SSR is quite useful to define global
queryCache
to handle errors or display toastr
, etc.
The way trpc initialize the react query client with nextJS using the createTRPCNext
doesn't give the option to access/call any hooks.
There is any other way to initialize trpc on NextJS that happens in the react component lifecycle as it would happen if we'are using only react query?![](https://utfs.io/f/528fd963-b216-444d-a476-9a456889fd23-4pl4mu.png)
0 Replies