V
V
Vyacheslav Shevchenko2018-11-01 19:31:45
css
Vyacheslav Shevchenko, 2018-11-01 19:31:45

How to build styles in react?

Hello.
Just starting to learn react + webpack and later redux.
The idea is to make a component with styles, and after the whole page is laid out, collect all the styles into one file and save it. Well, i.e. for example, there is a CatalogItem component; it has its own styles related only to it and NewsItem with its own styles. Well, in addition to these styles, there are styles for the entire site in a separate component, for example, App. We place on the page at /catalog/ CatalogItem, and on the page with url /news/ NewsItem. And after generating the page, we get a css file separate for /catalog/ and separate for /news/ and load only the file that we need depending on.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VIGF, 2019-05-08
@VIGF

I recommend looking at CSS Modules and Style Components.
And choose for yourself the option that suits you best.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question