Styled Components
There is a library which is very promising, because it takes into account all the problems the other libraries have encountered in styling components.
Different paths have been followed for writing CSS in JavaScript, and many solutions have been tried, so now the time is ripe for a library that takes all the learning and then builds something on top of it.
The library is conceived and maintained by two popular developers in the JavaScript community: Glenn Maddern and Max Stoiberg.
It represents a very modern approach to the problem, and it uses edge features of ES2015 and some advanced techniques applied to React to provide a complete solution for styling.
Let's look at how it is possible to create the same button we saw in the previous sections, and check if all the CSS features we are interested in (for example, pseudo classes and Media queries) work with Styled Components.
First, we have to install the library by running the following command:
npm install --save styled-components...