G
G
Georgy Kuznetsov2021-12-11 19:13:51
React
Georgy Kuznetsov, 2021-12-11 19:13:51

Should I always use css files for styles in React?

Is it worth it to get used to writing styles through css files when writing sites on React, or is it better to do with other means? And if so, by what means?

PS Due to dependency errors, I could not install Radium, so I decided to do with css files

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nowm, 2021-12-12
@JoeSmith3100

I like the option of using separate CSS files or defining styles with the tag <style>, because they can work with pseudo-selectors like "hover", "before", "after" and so on. Also, if you use the BEM methodology or the approach from Twitter Bootstrap, you can greatly simplify things, and then you will write the logic of the application in the JS code, and not solve design issues.
Plugins like Radium and the like force you to write more code and add new dependencies to your project. The less code and dependencies, the fewer potential points of failure and the easier it is to maintain and develop the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question