noahsolomon
noahsolomon14mo 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
noahsolomonOP14mo ago
if anyone has any insight it would be greatly appreciated : (
<DxD/>
<DxD/>14mo ago
Rendering: Client Components
Learn how to use Client Components to render parts of your application on the client.
<DxD/>
<DxD/>14mo 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/>
<DxD/>14mo 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/>
<DxD/>14mo ago
I am a beginner tho