themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.86k stars 416 forks source link

Event object isn't correctly passed to Dropdown.Item click handler #1440

Open jjchrisdiehl opened 6 months ago

jjchrisdiehl commented 6 months ago

Describe the bug The event object isn't properly passed to the Dropdown.Item onClick prop which leads to undefined when logged.

To Reproduce Steps to reproduce the behavior:

  1. Add a Dropdown component
  2. Add a click handler function to Dropdown.Item's onClick prop
  3. Try logging e or event
  4. See error

Expected behavior I expected to be able to access the e prop within the handler function and console.log the event object like so:

image

But unfortunately it logs out undefined.

Strangely, by removing the e prop and simply console.loging the event keyword I am able to access the event object, though my IDE marks it as deprecated:

image

Desktop (please complete the following information):