lukas
lukas2y ago

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?
0 Replies
No replies yetBe the first to reply to this messageJoin