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

Is it possible to not add dependence styled-components? #3

Open
fourteenmeister opened this issue Dec 16, 2019 · 4 comments
Open

Is it possible to not add dependence styled-components? #3

fourteenmeister opened this issue Dec 16, 2019 · 4 comments

Comments

@fourteenmeister
Copy link

No description provided.

@based-ghost
Copy link
Owner

No, not at the moment at least. However, looking at the roadmap for v5 of styled-components made it the best choice of all of the CSS-in-JS libraries in my opinion (in terms of performance and bundle-size). Version 5 is currently in a release-candidate state but it is stable and I have been using it in various projects with no issues, so, if you are worried about how it contributes to your bundle size v5 has a 31% smaller bundle-size than v4:

npm i styled-components@5.0.0-rc.2

@StarpTech
Copy link

Hi,
I just wanted to open the same issue. The lib looks really promising. I don't want to be forced to use a specific CSS-in-JS solution. I only want to reuse the logic of a select component. @based-ghost what do you think about this approach JedWatson/react-select#2706 (comment)

@based-ghost
Copy link
Owner

@StarpTech - Ahhh, yes in retrospect I wish I would have taken the time to build this out in a more modular way upfront, so that consumers of the package could opt-out of styled-components (thereby, avoiding the need to eat that dependency). At the time I started deving this lib the React Hooks API was fairly new, so writing the lib without the use of classic class components + providing the opt-out of CSS-in-JS functionality proved to be a little more than I was able to handle at the time.

Your comment reminded me to take another look at this though, since this is something I did want to investigate and there is probably a way to smoothly integrate this with the current lib. I wrote this lib in a way that would make it flexible for additions/changes like this - so, hopefully that proves to be the case with this functionality.

I'll keep you posted and also take a look into how react-select handled this - as that package was a source of inspiration for many other features I incorporated.

@based-ghost based-ghost reopened this May 6, 2020
@StarpTech
Copy link

Hi @based-ghost thanks for the feedback and keep up the good work.

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

No branches or pull requests

3 participants