Answer the question
In order to leave comments, you need to log in
How to properly style react components?
There is a react application divided into components. The task sounds like this: Connect style files in .tsx files only in those that are required.
How to do it right?
Answer the question
In order to leave comments, you need to log in
Keep the css file in the folder with the component. Import it into the component and write it as in the usual html.
Another option is to use module css. Not so convenient anymore, but there is a local scope.
The third option is styled components. There are small limitations, but in general, as I understand it, this option is used by many.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question