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:
export const metadata: Metadata = {
title: "Name",
description: "Securing your success!",
}
export const metadata: Metadata = {
title: "Name",
description: "Securing your success!",
}
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
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server