TS2605 JSX element type 'Button' is not a constructor function for JSX elements.

UI Components for React
Post Reply
User avatar
CodeMonkey
Posts: 6
Joined: 12 Dec 2012, 09:55

26 Mar 2021, 04:39

I recently have been playing around with JSX and everything works fine; but trying to convert to TypeScript (TSX) I run into issues. Lots of Stackoverflow posts are pointing to setting "allowSyntheticDefaultImports": true in my tsconfig.json; but it's already set. Has anyone else run into this issue?

Code: Select all

JSX element type 'Button' is not a constructor function for JSX elements.  TS2605

    33 |     return (
    34 |       <div>
  > 35 |         <Button />
       |         ^

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

06 May 2021, 13:34

Interesting! I couldn't replicate this issue. We have Class, Hook and TS demos for each component on showcase. Please see Button demo with TS;
https://codesandbox.io/s/p3olp

Best Regards,

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests