DropdownItem as button
#1510
Replies: 1 comment
import {DropdownItem} from 'flowbite-react';
import {useTranslations} from 'next-intl';
import React from 'react';
import {signOut} from '@/auth';
export default function SignOut() {
const t = useTranslations()
async function signOutAction() {
"use server"
await signOut({redirectTo: "/"})
}
return (
<>
<DropdownItem onClick={signOutAction}>
{t('auth.sign_out')}
</DropdownItem>
</>
)
} |
0 replies
Answer selected by
idc77
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Using NextJS and next-auth v5
I can't put a
<button>inside because you can't have a button in a button.But I need the submit to fire. However while DropdownItem extends button, it's not recognized by the form as a valid button element.
All reactions