tRPCttRPC
Powered by
wleistraW
tRPC•4y ago•
1 reply
wleistra

Global context or shared context.

We are using react query and trpc and we ran into a undesired effect I hope someone could help me with. We have a monorepo with 20+ frontend applications (all in react/ts). Some of those apps/utilities export components that are used in other apps. Each utility/app has its own trpc server middleware for providing data to our components. Every app is wrapped in a trpc.provider and query Provider. So if we want to use a component from utility A requesting data from server A in app B we wrap that component in query provider from A. This works fine, except if app B utilizes multiple components from utility A in that case invalidating a query in one component from A, will not invalidate the other component query as both get their own context... Is there a way to share the same context somehow? 🙏
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

useQuery context
Answer OverflowAAnswer Overflow / ❓-help
3y ago
context question
VilianVVilian / ❓-help
3y ago
[Help] Turbo shared types
typedefTtypedef / ❓-help
3y ago
Creating inner context for AWS Lambda Context Options
NicolasNNicolas / ❓-help
3y ago