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

[Installation] How to install only a few components? #1922

Closed
shankara403 opened this issue Aug 2, 2017 · 3 comments
Closed

[Installation] How to install only a few components? #1922

shankara403 opened this issue Aug 2, 2017 · 3 comments
Labels

Comments

@shankara403
Copy link

Hello, I wish to use only a few components of SUI in my react application. Even if I import only a few components the whole library which is close to 1 MB uncompressed is imported. Is there anyway I can only import an element and its dependencies?

Any help is appreciated! Thank you.

@layershifter
Copy link
Member

layershifter commented Aug 3, 2017

Please post your questions on SO. You can directly import components:

import Button from 'semantic-ui-react/dist/commonjs/elements/Button'

But recommended way is to use babel-plugin-lodash, see #609 and our docs. Also see this reply on SO.

@eduludi
Copy link

eduludi commented Aug 18, 2017

With

import Button from 'semantic-ui-react/elements/Button'

I get

Module not found: Error: Can't resolve 'semantic-ui-react/elements/Button' in '...'

Does this requires a special Webpack configuration?

Thanks.

@layershifter
Copy link
Member

layershifter commented Aug 18, 2017

There was a typo, correct:

import Button from 'semantic-ui-react/dist/commonjs/elements/Button'

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

No branches or pull requests

3 participants