Skip to content

Client Component doesn't work #42319

Answered by icyJoseph
0x0range asked this question in Help
Nov 1, 2022 · 2 comments · 9 replies
Discussion options

You must be logged in to vote

There's confusion about the client directive. It means that this component, also runs on the client. I've seen a lot of material out there which says only. Rather client components are like the components we wrote before. In order to send a full HTML frame from the server, client components run on the server too!

This bit from the next.js docs:

Client Components are rendered on the client. With Next.js, Client Components can also be pre-rendered on the server and hydrated on the client.

I'll keep on investigating but for sure, unguarded DOM access in an SSR context still seems fishy.

Edit notes

  • Even though the server fails and the first HTML frame is not meaningful, the client seems to…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@0x0range
Comment options

@icyJoseph
Comment options

@dejurin
Comment options

@benoitv-code
Comment options

@junioryono
Comment options

Answer selected by 0x0range
Comment options

You must be logged in to vote
4 replies
@ashreyas431
Comment options

@icyJoseph
Comment options

@ashreyas431
Comment options

@icyJoseph
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants