DEV Community

Discussion on: Beginner's experience with React - a shout for feedback

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí

CSS-in-JS or not?

I personally like it, how the code looks at the end depends a lot on what you are using, with styled-components you will get a new component for your styles and you could move that component to another file if it makes sense.

But if you are more comfortable using CSS outside JS do it, it’s not a requirement, eventually when you start to make bigger apps in bigger teams you may reach a point you could justify the usage of CSS in JS.

Collapse
 
itsjzt profile image
Saurabh Sharma

I have seen a lot of people like CSS modules because they are CSS but still encapsulated.

Collapse
 
devshehata profile image
Mahmoud Shehata

I'll look into styles components more...
The Idea of the CSS modules looks really good! I think it's a good balance and actually solves the problem in an elegant way