One of the great things about React is that it lets us collocate a component's markup, behavior and styles in a single file. This collocation has cascading effects (no pun intended) on the developer experience, version control, and code quality over time. In this chapter, we'll briefly explore what CSS-in-JS is and how we can approach CSS-in-JS in Reason. Of course, it's perfectly valid to break a component up across separate files and/or use a more traditional CSS solution, if that's what you prefer.
In this chapter, we will be looking at the following topics:
- What is CSS-in-JS?
- Using styled-components
- Using bs-css