-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button can't be rendered as it's return type is ReactNode. #962
Comments
What React version are you using? |
"react": "^18.2.0" I think the issue is caused by this, but the fix is really fast, just need to change the component return type to JSX.Element |
Well if you can change it within your project and it works, go for it, but what about @types/react? |
I'm facing this issue too.
This started happening when I updated to version 0.6.0 |
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. fix themesberg#962
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. fix #962
Hi then followed steps from there https://www.flowbite-react.com/docs/getting-started/introduction I've installed latest version of flowbite-react (0.7.3) I've put a button on my app
and got
thanks for any help |
Looking into it, will push and release a fix ASAP. |
Note that this also affects |
Yeah |
…tem to JSX.Element In themesberg#1244, the return type of Button and DropdownItem was changed to ReactNode. This is not an acceptable return type for functional components. The correct return type is JSX.Element. This change fixes the regression from that PR (introduced in v v0.7.3 A Also fixes themesberg#962. fix themesberg#962
Looks like this library is going to be broken for a while (based on code freeze announcement and the length of time the fix PR has been sitting). In the meantime, everyone will have to |
After some tests, if people are on |
I'm not seeing that. On TypeScript 5.4 and the issue persists. |
I got a dirty solution, until we get it properly working and/or refactor the polymorphic forwarded ref component. Stay tuned. |
Fixed by v0.7.5 release. |
awesome, it works for me after I restart my VSCode |
Steps to reproduce
Current behavior
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
The text was updated successfully, but these errors were encountered: