Answer the question
In order to leave comments, you need to log in
How to improve the reusability of styles in styled-components?
After a certain time of working on a project where styled-components is used for layout, I began to catch myself thinking that I often have to copy-paste pieces of code like:
display: flex;
flex-direction: row;
width: 100%;
Answer the question
In order to leave comments, you need to log in
Create a separate file and pass through the props.
But in general, you can duplicate the style. But he takes his place!
If the project will move in positions in the search results, then page loading speed is important for the robot. Perhaps these dozens of lines will separate your site from the first place)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question