-
Most components have "use client", is it necessary? Some components seem to have "use client" even though they do not have event listeners or state. For example, the label component. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The It's likely that the majority of primitives employ various event listeners, which is why the wrapper component includes the |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
The
useClient
is essential whenever an event listener is utilized - just as you mentioned. If you take a glance at the radix label primitive, you'll notice that it employsonMouseDown
.It's likely that the majority of primitives employ various event listeners, which is why the wrapper component includes the
useClient
directive.