Closed Steffi3rd closed 5 years ago
RDT's styling is built atop styled components and it's required as a peer dependency. It would not be possible without re-writing half the library. I initially thought about writing RDT with scss to keep things un-opinionated but it added a ton of overhead.
btw, if space is a concern, styled-components v5 is 12.33kB min+gzip at 4.3.x is around 16kb.
It would be interesting though if we could abstract the css-in jss to where you could bring your own 🤔
I'm curious as to why styled-components is a peer dependency instead of a dependency of react-data-table-component, though. Makes our package.json a little polluted.
@jbetancur any thoughts on that?
@m4rcelofs I had the same concerns about package.json "pollution" and install confusion, but my rationale for this was for cases where you use a styled-components version that is different than RDT's version. In that case, if you use styled-components in your app, then having it as a dep increases the bundle size unnecessarily so. I believe you would then have multiple version of styled-components instead of just one dependency and I am not even sure what sort of bugs that would introduce.
Aside from that, what put me over the edge was that styled-components recommends against bundling it in with libraries:
Hope that clarifies.
Describe the bug
This dependency was not found:
To install it, you can run: npm install --save styled-components
I don't want to use Styled Components, I already use Emotion.
Can we avoid to install it?
To Reproduce
yarn add react-data-table-component