Improve error message when using per function "use server" in Client Components (#52214)
The current message isn't very clear about `"use server" function` and `"use server" file`, and there's no link to docs to explain it further: ``` "use server" functions are not allowed in client components. You can import them from a "use server" file instead. ``` This PR makes it a bit more verbose: ``` It is not allowed to define inline "use server" annotated Server Actions in Client Components. You can either mark the entire file by putting "use server" at the top, or pass them down through props from a Server Component. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions#with-client-components ```
Showing
Please
register
or
sign in
to comment