tRPCttRPC
Powered by
lukasL
tRPC•4y ago
lukas

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
queryCache
to handle errors or display
toastr
toastr
, etc.

The way trpc initialize the react query client with nextJS using the
createTRPCNext
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?
unknown.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to use NextJS tRPC client without hooks?
imhoffdIimhoffd / ❓-help
3y ago
How to use client and react-query simultaneously?
MnigosMMnigos / ❓-help
17mo ago