themesberg / flowbite-react

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

Element missing "props" property. #1177

Closed kamilernerd closed 8 months ago

kamilernerd commented 8 months ago

Steps to reproduce

Install the latest flowbite in a vite react + swc + typescript project Copy the navigation bar example with dropdown menu and add it into your component.

Current behavior

Adding a dropdown element to my component produces: JSX element class does not support attributes because it does not have a 'props' property.ts(2607) The rendering crashes

Expected behavior

Not crashing

Context

Trying to rewrite old flowbite (css + js) component to a react-flowbite component

kamilernerd commented 8 months ago

It turns out I was a little too fast with filing a bug. The issue was caused by wrong import. Rather than importing "Dropdown" from "flowbite-react" I imported it from "flowbite". Sorry for the inconvenience. This issue can probably be closed.