Skip to content
Discussion options

You must be logged in to vote

Hi,

use client means bundle to ship to a browser. It is a hint to bundlers, amongst other things, but unfortunately, many tech-influencers jumped the gun and used language that made it sound like these are correlated to browser API usage, which is again, not the case.

One would use a use client directive to hint at interactivity rather, that this module contains JavaScript that runs client side.

And since useState and a few others, do need JavaScript to do the state updates and such, you need the use client directive when using them.

It becomes a bit more annoying when barrel files are at play, because those mix concerns from various modules, and, to be honest, I am not 100% cut clear on …

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@icyJoseph
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by FrancoRATOVOSON
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants