tRPCttRPC
Powered by
quiet-anteater-9502Q
tRPC•2y ago•
3 replies
quiet-anteater-9502

Is there a way to use TRPC React Query Integration with Nanostores instead of the Context API?

Currently we use TRPC by wrapping out application in a TRPC context provider. However, in some use cases, such as an Astro App, we don't want to wrap our entire app in a React Context. A common solution is to share state between Astro islands using nanostores (https://docs.astro.build/en/recipes/sharing-state/). I wanted to know if there is any way to share the TRPCReact client between Astro components using nano stores, without needing to use a React Context Provider.

We can already share the React Query client between components using nanostores by passing the client as a parameter to the useQuery function. However, I could not find an option to pass the trpc client in the same way. I would greatly appreciate any help on this.
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

Is there a way to use a more updated version of React Query in tRPC?
MikeyMMikey / ❓-help
3y ago
Is it possible to use tRPC React Query Integration without defining a trpc provider?
w7tfWw7tf / ❓-help
2y ago
Is there a way to alter the query key generated by trpc?
asliwinskiAasliwinski / ❓-help
3y ago
trpc subscription with react-query
kamamaKkamama / ❓-help
3y ago