You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the use client directive means "Client component", Some people might think use server can be considered as "Server component" or "Server only".
However, the use server directive has been used for declaring Server Actions. Instead, import 'server-only' stands for"Server only", this naming is not straightforward, I'm wondering why we can't use use server instead of import 'server-only'.
It would be great if we can do something like this:
'use server';//Component below cannot be used in client componentsexportfunctionServerOnly(){return ...
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Since the
use client
directive means "Client component", Some people might thinkuse server
can be considered as "Server component" or "Server only".However, the
use server
directive has been used for declaring Server Actions. Instead,import 'server-only'
stands for"Server only", this naming is not straightforward, I'm wondering why we can't useuse server
instead ofimport 'server-only'
.It would be great if we can do something like this:
use action
directive instead ofuse server
:Beta Was this translation helpful? Give feedback.
All reactions