SolidJSS
SolidJS14mo ago
5 replies
sh03

Confusion about `"use server"`

I have a few questions related to "use server":

1. Should all server-only files be "use server"? If not, why not?
2. I see that you can export anything other than a function from a module that is tagged with "use server", what's the reason for it?
3. Does "use server" on a module expose all functions from that module to the public (e.g. they can be called from the outside in a RPC fashion)?
4. Should I only mark "use server" functions that I intend to call on the client?
Was this page helpful?