Skip to content
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

Removed unused import. #3679

Closed
wants to merge 1 commit into from
Closed

Conversation

AbhinasRegmi
Copy link

Do we really need the import to react here ?? In my project I removed the import and the theme worked fine.

Do we really need the import to react here ??
Copy link

vercel bot commented May 6, 2024

@AbhinasRegmi is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@shanehoban shanehoban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be redundant if you are using for example NextJS, as you don't need to import React, it's automatically done for you.

If you are using shadcn-ui in other projects, perhaps older ones that use webpack as an example - then it would be painful to have to re-add this line to every component (and after every update via the CLI).

Also as a side note, it's completely fine to leave the import in if your using NextJS - it's not going to bloat your build.

@AbhinasRegmi
Copy link
Author

So it will bloat the build if we are not using any react related functionalities in there. Got it.

@shanehoban
Copy link

Probably not actually... depending on your build process. If you have unused imports they may not be used/bundled at all. Just do two builds to see, one with the import and one without.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants