#Using server components with external API

6 messages · Page 1 of 1 (latest)

meager fog
#

If we use server components that fetch from an external API(e.g. from a expressJS backend) then send the response back to the client, does this slow the webpage more than using a client webpage? As the request goes from client->nextJS server->backend. Is it better to just use a client component?

unique gustBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

late tusk
#

Is it better to just use a client component?
Yes. It depends if you want the benefit of server rendered component or not. Some people finds it easy to implement fullstack app with server component and client components, some people just go full SPA

meager fog
#

does the client component get entirely rendered in user's browser or the server renders some part of it already before sending the response?

late tusk
#

the latter