Use State and metadata API in the same component (next 13 app dir)
I have a component that's marked with "use client", because I also want to use useState but I also want to set some metadata on it, so I added this:
but i get this error when deploying on vercel:
You are attempting to export "metadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://beta.nextjs.org/docs/api-reference/metadata
is there a way I could use both in the same component?
0 Replies