I'm getting the following error, but I don't understand why NextJS thinks this is a client component. I even have 'use server' at the top of the file
Error:
× It is not allowed to define inline "use server" annotated Server Actions in Client Components.
│ To use Server Actions in a Client Component, you can either export them from a separate file with "use server" at the top, or pass them down through props from a Server Component.
│
│ Read more: https://nextjs.org/docs/app/api-reference/functions/server-actions#with-client-components
│
╭─[/..../nextjs/app/tenants/add-form.tsx:8:1]
9 │
10 │ export async function AddForm() {
11 │ ╭─▶ async function createTenant(prevState: any, formData: FormData) {
12 │ │ 'use server'
13 │
14 │ │ ..... do stuff to create the tenant, call APIs, etc
40 │ ╰─▶ }
41 │
42 │ return (
43 │ <form name="newtenant" id="newtenant" action={createTenant}>
╰────