Server and Client Component decision #82046
Unanswered
kratess
asked this question in
App Router
Replies: 1 comment
-
Make the banner a Server Component by default.
Only < EditableBanner /> needs to be a Client Component, because it has click handlers You can add suspensive bounder if you want to. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a page for user in nextjs. I have a part of the page with a user banner. If the user's page belongs to the actual logged-in user then the banner displays a edit icon that can be clicked to edit, if doesn't then its a static image.
In nextjs how should i face this feature? Should i create 2 components? One client component to send if user requisting page is who the page belongs to and a server side component that indeed is only a static image to send to anyone else? Or should i build it all client component and leverage ppr? Or even should i do a dynamic banner render, with a default server side component plus an additional component for editing that only renders if user is the owner of the page?
Beta Was this translation helpful? Give feedback.
All reactions