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.
B
blueWhale•18d ago
Right now I am wrapping each of my React Islands in a separate context provider. I don't think that's scalable.
4.8KMembers
View on DiscordMore Posts
What do you guys think about the approach of importing/exporting tRPC types to be used in separate BHello,
I was looking for a way to share tRPC API between multiple electron apps, I thought first abHow to add fallback link to tRPC link (Mirror API URL if main URL failed)My API URL is not functioning in Iran, I'm using Vercel and Vercel has banned Iran,
I want to providHow can I show real-time post's replies/comments after a successful a reply mutation?After submitting a successful reply mutation, I want to show a real-time UI update on my frontend?Quick question: how to get mutation body in a middleware, which is for a global logging?Hi everyone!Quick question:
The pic shows that the output of "input" is undefined. Is there any anotError with v11 when using batchingI'm using the lastest version of v11. When I use the batch link I get an trpc inernal error when battRPC failed on <no-path>: `headers` was called outside a request scopeI'm using NPM
GET /api/trpc/post.test?batch=1&input=%7B%220%22%3A%7B%22json%22%3Anull%2C%22meta%22%