Skip to content

Commit 6174b74

Browse files
committed
Fix profile menu crash on Headless UI Menu.Item
Menu.Item was rendering a Fragment which Headless UI cannot attach props to (id, role, tabIndex, event handlers). Added as="div" to render an actual element.
1 parent 1561367 commit 6174b74

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

app/components/_layouts/navbar/profile-menu.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ export default function ProfileMenu({ user }: { user: User }) {
3333
leaveTo="transform opacity-0 scale-95"
3434
>
3535
<Menu.Items className="absolute right-0 z-10 w-48 py-1 mt-2 origin-top-right bg-white rounded-md shadow-lg dark:bg-background-800 ring-1 ring-black ring-opacity-5 focus:outline-hidden">
36-
<Menu.Item>
37-
<>
38-
<div className="block px-4 py-2 text-xs font-light text-gray-500 dark:text-gray-300">
39-
Olá {user.name}
40-
</div>
41-
<hr className="dark:border-gray-800" />
42-
</>
36+
<Menu.Item as="div">
37+
<div className="block px-4 py-2 text-xs font-light text-gray-500 dark:text-gray-300">
38+
Olá {user.name}
39+
</div>
40+
<hr className="dark:border-gray-800" />
4341
</Menu.Item>
4442
<Menu.Item>
4543
{({ active }) => (

0 commit comments

Comments
 (0)