"use server"; Help
I'm trying to understand how
Is it safe to assume that everything under
So, inside of the following function, only
However, when you call
Excerpt from the
I'm asking because the docs say...
"To create a function that only runs on the server, pass a function as a parameter to server$."
But I don't see any usage of server$ in the example projects.
Thanks,
Chris
"use server"; works.Is it safe to assume that everything under
"use server"; runs on the server (of course scope dependent).So, inside of the following function, only
console.log(message); could run on the server.However, when you call
"use server"; at the top of a file, like in the server.ts file in the with-auth example, then all code runs on the server.Excerpt from the
server.ts file from the with-auth example project.I'm asking because the docs say...
"To create a function that only runs on the server, pass a function as a parameter to server$."
But I don't see any usage of server$ in the example projects.
Thanks,
Chris
