Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #1

Open
VladSez opened this issue Jul 20, 2024 · 2 comments
Open

Question #1

VladSez opened this issue Jul 20, 2024 · 2 comments

Comments

@VladSez
Copy link

VladSez commented Jul 20, 2024

Can you please clarify why top level “use server” is considered bad?

@benjamin-guibert
Copy link

If I've to guess, this might be related to the fact that every exported function in a "use server" file is automatically a public API. This rule could prevent you from mistakenly expose a function to the client.

Here is a good video about the traps : https://www.youtube.com/watch?v=yBEHKoaoZpY

@benjamin-guibert
Copy link

@c-ehrlich It would be nice to give an explanation in your README file please. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants