noahsolomon
noahsolomon9mo ago

tRPC requests on client vs server for NextJs

Hello, I'm new to tRPC, and am confused on one thing. I have watched videos of some using a server client to make their tRPC requests on server side with async/await before sending the data with html back to the user, and the more common approach I've seen is requesting with 'use client'. When is it practical to use these approaches?
Also, I don't quite understand how to properly set up a server client in tRPC with next in regards to providing context.
5 Replies
noahsolomon
noahsolomon9mo ago
if anyone has any insight it would be greatly appreciated : (
DxD
DxD9mo ago
Rendering: Client Components
Learn how to use Client Components to render parts of your application on the client.
DxD
DxD9mo ago
I use “use client” when I work only on fe Create some components Basics front Things I do not understand first question With async await I hope is ok for third question
DxD
DxD9mo ago
Web Dev Simplified
YouTube
Learn tRPC In 45 Minutes
Highlight: https://app.highlight.run/?promo=SIMPLIFIEDHIGHLIGHT Coupon Code: SIMPLIFIEDHIGHLIGHT (This should be automatically filled in as you go through the signup process) tRPC is an incredible library that makes working between your client and server so much nicer. The best part of tRPC is how it brings type safety to your API and client i...
DxD
DxD9mo ago
I am a beginner tho
More Posts
passing user input state variable to all api callsI have a multi organization app and need a way of passing the current organizationId on all requestsIs there a way to extract a procedure signature?I'm looking into extracting certain handlers into functions to keep certain procedures more manageabIs there a pattern for omitting certain types of errors from being returned in the API responseI'd prefer not to expose the ORM queries being used in my resolver. I'm already providing an `onErroDynamic input not leading to changes on the front endI'm building a dynamic procedure to access my database via Drizzle ORM. Ideally a developer would btRPC with with react-query prefetching in Next.js app directory.Hi. What is currently the best way to do prefetching in Next.js app directory when using @tanstack/rHello, is there any way to create a base router with common procedures? like an interfaceI want all routers that use it have the state procedure (subscriptions), so I can create a common hHelp Retrieving req.url from opts in useMutation from tRPCHello, i'm trying to essentially send a magiclink email using supabase client libraries, however, i'Express tRPC NextJSI've custom expressjs server with Nextjs + im using internal package for handling OneLogin (OIDC) hoDynamic links url dependent on next headers?Hi, We're currently explore if we can use trpc on a multi tenant next.js 13 application. But we cancalling TRPCProxyClient from inside trpc procedure fails on vercel route handlers edge runtimei setup my client as following: ``` export const serverToServerApi = createTRPCProxyClient<AppRouter