-
-
Notifications
You must be signed in to change notification settings - Fork 446
Performance pitfall - imports not tree shaken #1197
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
Comments
Hey, @timthedev07, thanks for reporting it. It would require some changes to the library export. Feel free to do it if someone is interested in working on this.
Ideally, I would expect to have something like: import Button, { ButtonTheme, ButtonProps } from 'flowbite-react/components/button'; |
Is this still an issue if you add |
First thing I've noticed is that the theme file might be something to be reviewed, I'm not sure if it is affecting the other components exports, but, definitely would take a look into separating the themes exports/imports into separated files. |
I'll try to dig into the cause of the components tree shaking as well. |
…ake single components Each component now is treeshshaken individually into the final build BREAKING CHANGE: How import components themesberg#1197
Excited to see this coming! |
Are you able to build the next.js project with the flowbite-react as dependency? |
Beautiful @SutuSebastian ! |
Steps to reproduce
Current behavior
All components are imported.
Expected behavior
Only the desired component should show up.
Context
The text was updated successfully, but these errors were encountered: