Wrapper Component: Unable to retrieve application context.
Hello tRPC-Community,
I have ran into a funny "issue" while gaining my first experiences with tRPC.
If I want to use tRPC in a React Component the documentation states that the Component should be wrapped by some Helper-Component from react-query.
Now I want to be as flexible as possible and only want to "declare" the Wrapper-Component once:
QueryWrapper.tsx
:
I always get the Error you see in the Picture.
Now to the weird part, as soon as I "use" the wrapper differently it works:
Now that makes the wrapper completely unflexible. What basically is the issue.
Does anybody know why? This makes using tRPC very uncomfortable and repetitive...
Thank you in advance!
~Max5 Replies
this seems like an astro issue not trpc
Why do you think so? It is basically just react.
Here is a link to a StackOverflow Post from someone who describes the same problem with a completely different framework...
https://stackoverflow.com/questions/77187229/expo-trpc-unable-to-retrieve-application-context-did-you-forget-to-wrap-your
Stack Overflow
Expo + tRPC: Unable to retrieve application context. Did you forget...
I have pretty simple tRPC server:
// server.ts
import { initTRPC } from "@trpc/server";
import { z } from "zod";
const t = initTRPC.create();
export const appRouter = t.router...
youre right - i was able to reproduce this as well. not sure why that happens.
I have 0 experience with open source contribution. Is it alright to open a GitHub Issue for this?