flowbite-react: Button can't be rendered as it's return type is ReactNode.
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Steps to reproduce
- Create a CRA,
- Install flowbite react
- Add a button to a page
Current behavior
TS2786: 'Button' cannot be used as a JSX component.
Its return type 'ReactNode' is not a valid JSX element.
Type 'undefined' is not assignable to type 'Element | null'.
Expected behavior
To normally render a Button
Workaround
CTRL/CMD+click on Button component will bring you to the .d file, there change the last NodeElement into JSX.Element. After this restart the server
I might fix this bug myself when i have 10 free minutes if noone picks this up before me
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 5
- Comments: 17 (5 by maintainers)
Commits related to this issue
- fix(button): fix error Button cannot be used as a JSX component Fix error after updating to v0.6.0 Button cannot be used as a JSX component. Its return type 'ReactNode' is not a valid JSX element. f... — committed to congon4tor/flowbite-react by congon4tor 9 months ago
- fix(button): fix error Button cannot be used as a JSX component (#974) Fix error after updating to v0.6.0 Button cannot be used as a JSX component. Its return type 'ReactNode' is not a valid JSX ele... — committed to themesberg/flowbite-react by congon4tor 9 months ago
- fix(button & dropdownitem): reverts return type of Button & DropdownItem to JSX.Element In #1244, the return type of Button and DropdownItem was changed to ReactNode. This is not an acceptable return... — committed to BigleafNetworks/flowbite-react by rnicholus 4 months ago
The DropDown.Item is not yet fixed, after making modification on my pc changing
ReactNodetoJSX.Elementi can then build on my pc but using GitHub actions or any pipeline is impossible unless its fixed on the npm server, i hope the administrators can do something about this.awesome, it works for me after I restart my VSCode