Next.js Discord

Discord Forum

ShadCnUI Dropdown Menu Item issue

Unanswered
Montezuma Quail posted this in #help-forum
Open in Discord
Avatar
Montezuma QuailOP
I'm taking a Udemy course on Next.js and I'm trying to call a server action from a button thats inside of a form thats inside of a DropDownMenuItem. The server action is never getting called and I've been struggling to figure out why. My code looks like this:


<DropdownMenuItem className='p-0 mb-1 '>
<form action={signOutUser} className='w-full'>
<Button
className='w-full py-4 px-2 h-4 justify-start'
variant='default'
>
Sign Out
</Button>
</form>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>

0 Replies