Skip navigation
Client/Server composition with server components feels illegal ๐Ÿ˜…
0:00 / 1:01

Client/Server composition with server components feels illegal ๐Ÿ˜…

Alex Sidorenko

@asidorenko_35K followers

Visit on X
781 likesDownloadOriginal post

69,174 views

Client/Server composition with server components feels illegal ๐Ÿ˜…

10 Comments

Comments from the original post on X (Twitter)

  • Savva Mikhalevski's profile picture

    @smikhalevski

    This can be done with the same number of lines using regular REST. But with rate limiting, caching, proper security, and separation of concerns.

    7 likes

  • jarindr.eth | zentry โšก๏ธ's profile picture

    @jarindr

    Can someone tell me what's the benefit vs calling API and update result on the client again? Not talking about you don't need "backend"

    3 likes

  • Alex Sidorenko's profile picture

    @asidorenko_

    I think it's mainly this 1. Eliminate the problem of duplicating and synchronizing the data state on the client 2. Great potential for shared full-stack components in the future

    3 likes

  • Eric Afes's profile picture

    @eriicafes

    So having a key on the Suspense forces the server component to rerun? ๐Ÿค”

    2 likes

  • Alex Sidorenko's profile picture

    @asidorenko_

    The server component reruns because of the query params updates (regardless of the key on the Suspense). The key on the Suspense re-triggers the suspense fallback on every re-run. Here is how it would work without it.

    8 likes

  • Abdulrahman's profile picture

    @DoudGaya

    Itโ€™s legal though ๐Ÿ˜‚

    1 like

  • Fredkisss is on ๐Ÿฆ‹ blue sky ๐Ÿฆ‹'s profile picture

    @fredkisss

    This is actually incredible ๐Ÿคฏ

    1 like

  • Kofi Bamfo Quaicoe's profile picture

    @KbqTech

    Can you please make a @YouTube tutorial for all these...

    1 like

  • Alex Sidorenko's profile picture

    @asidorenko_

    @YouTube What would you like to see in a tutorial?

    1 like

  • Salik Jamal's profile picture

    @salikjamal20

    These tutorials are always great man, Next.js is awesome!

    1 like