Re:Show HN: Single-file components for React
by allover on Thursday October 05, 2017 @01:33PM
(#15410915)
Several CSS-in-JS libs support all of CSS, and allow you to write actual CSS and not camelCase styles.
styled-components [1] is prob the most popular example.
Your complaint they are evaluating JS just to set styles is valid, tho some libs, like emotion [2] support static CSS extraction.
[1] https://www.styled-components.com/docs/api#supported-css [2] https://github.com/emotion-js/emotion
CSS-in-React is sometimes pretty useful, but personally I'm not in love with it... because the attribute names are camel-cased, and you're running JS code to set styles that the browser already has a mechanism for that doesn't need to run code.