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

  1. Create a CRA,
  2. Install flowbite react
  3. 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

Most upvoted comments

The DropDown.Item is not yet fixed, after making modification on my pc changing ReactNode to JSX.Element i 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.

git

awesome, it works for me after I restart my VSCode