T
tRPC

TRPCContextState not found in v10

TRPCContextState not found in v10

GgwaiLoFi6/5/2023
In our v9 app, we used TRPCContextState from internals to type out TRPC utils, importing it like import { TRPCContextState } from '@trpc/react-query/dist/declarations/src/internals/context'; and using it in types like trpcUtils: TRPCContextState<AppRouter, any>; Is there a quick alternative to this? Can't find it in the the latest trpc10 code packages.
AKAlex / KATT 🐱6/5/2023
I can't remember what that was used for, could you elaborate on what you need it for?
GgwaiLoFi6/5/2023
Typing out trpc.utils maybe, it is hard to tell. The interfaces I see it in are very type-happy Yeah, I'm seeing it used as a type for trpc.useContext() perhaps a better question: is there a type we can use for trpc.useContext() in trpc 10?
AKAlex / KATT 🐱6/5/2023
What's the functionality you need to abstract? If you show me the fns you have created in v9 it'd be easier to give guidance What sort of helpers are you making?
GgwaiLoFi6/6/2023
We're putting trpc.utils in ReactContext state, so we've been using TRPCContextState for trpc.utils in ReactContext interface
AKAlex / KATT 🐱6/6/2023
You could just use typeof trpc.utils then for your type, right?
GgwaiLoFi6/6/2023
Thanks Katt, that does it... seems so obvious now 😂

Looking for more? Join the community!

T
tRPC

TRPCContextState not found in v10

Join Server
Recommended Posts
RateLimiter for fastify tRPC routesHi, I would like to add Ratelimiter to a specific fastify trpc route, are there any solutions availaSubscriptionsare we able to send data over with subscriptions, to allow for full duplex communication ?Query tRPC the right wayIf you use graphql, you can precisely query what you exactly need and avoid over fetching, so you caHow does trpc subscription actively close/disconnect in the server?How do I actively disconnect my subscription?child router questionlet's say we have a monorepo, one server, two client apps (cat and dog). we make one appRouter, likHow to force SSL on projects using tRPC?Hello everyone, I'm working on a project that uses create-t3-app as boilerplate. My project is hosAWS Lambda / How to set Cookies inside ProceduresHow can I set and remove cookies similar to ctx.res.cookie(..) with Express when using the aws lambdMassive Type Errors on tRPC 10 Legacy Router against MergeRouterWe're trying to upgrade to tRPC 10 but I am running into a massive type clash when trying to merge rIs it possible to create 2 routers inside a single file?I am having an issue in which it is impossible to me to use a class instance within 2 routers. I triUse onError to change an application error into a TRPCError?I want to use the onError handler to change any instance of a custom application error into a TRPCErIncreasing Body 1mb limitHey, Im trying to build an application that allows sending of base64 encoded files to my next.js serNitro and tRPC in vercel-edgeHey there! I hope this is the right place to ask for help. I am trying to deploy an application witHow to retrieve and receive Bigint data to/from TRPC procedureNode: `v16.15.1` I'm trying to return an object which contains an `amount` property from one of my React Router Loaders + tRPC?In Vite project: would it make sense to use React Router loaders with tRPC? I like more the concept TypeError: Cannot read properties of null (reading 'useContext') when using useMutation with TRPC inI'm encountering an error in my Next.js application when trying to use the useMutation hook with TRPInitial websockets getToken() returns null: next-auth + websockets :)Hello! So the way I am trying to authenticate websockets is like this: ``` import { getToken } froCan I get the original type name, instead of the shape, with query?I'm not sure how to explain it, so, here's a screen shot:TRPCClientError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON ErrorHello folks, I'm getting an issue with my integration, I'm a newbie in tRPC and I can't work well mytrpc corsmy sveltekit app is running on https://example.com with tRPC and it's making requests to http://127.T3 app tRPC external callsCurrently i'm just making Post request and formatting my payload to ```{ "0": { "json":