riprsa
riprsa2w ago

Cannot figure out the correct type

I am trying to use tRPC outside of React. I use it in React, but I need a separate way to use it. I found out about trpc.useUtils().client, which is perfect. But I want to make it a global object for CSR components. I cannot figure out the right type to include in to the declaration. Thank you
Solution:
export const api = createTRPCClient<AppRouter>({ ... })
Jump to solution
2 Replies
riprsa
riprsa2w ago
hm, i got a horrible error when i tried to use it, so may be i need a different approach
Solution
riprsa
riprsa2w ago
export const api = createTRPCClient<AppRouter>({ ... })
More Posts
Trying to get the return type of a procedure.Using TRPC v11. I am failing to return the type. I get the error Type alias 'ProtectedProcedureType'Having great difficulty using StreamingI wanted to use the stream api with tRPC to handle a response with alot of return values and I lookeUnable to abort Suspense queriesI am using trpc@11 with react-query@5. I was under the impression that as long as abortOnUnmount is Authorization and Authentication while using unstable_httpSubscriptionLinkI'm wondering what best practices are for specifying headers like bearer tokens when using httpSubscCustom data transformer and input/output schemaHello 👋 I would like to code a data transformer, but I would this data transformer to be aware ofProperty 'error' does not exist on type 'MiddlewareOKResult<any>'.Hello, I am building an trpc adapter for nestjs, and I am trying to extend some of trpc's functionalI'm unable to make a GET request in postman. But able to make post requestsI get: `expected object received undefined` what could i be doing wrong? these are my routes, the pThe inferred type of 'trpc' cannot be named without a reference to '...'I have a monorepo setup like this: root -tsconfig.json -frontend --tsconfig.json -backend --tsconfiUpdate a query with setData avoid calling invalidateQueries ?I have this code, which is cancelling all the queries for an specific router, then it's updating thesending messages via WebSocketsHi, do I have the possibility to send messages via wsLink? I want to connect to Binance and be able