Long story short, I'm a newer dev at a company. Our product uses React/TS/StyledComponents. One of the other devs makes a new StyledComponent for every small little thing. Is this good usage? For me it seems easier and more readable to use a P tag and add a classname versus creating a StyledComponent for it. Especially if its just some text with barely any styles to it. So instead of writing...
<p className='title-text'>Title Here</p> they write... <TitleText>Title Here</TitleText> but for everything??
I feel like it causes a lot of context switching where other devs would have to grok whether you are working with another 'actual React component' or not. Then have to go to the style file and see what tag it really is etc. I find it much easier to see a P tag and know exactly what I am working with in a fraction of the time. Am I completely wrong on this?
Bla
Bla bla
Not every element needs to have its own Styled-Components declaration. Semantic HTML is supposed to be targeted like this. It's a weaker specificity, but since it's encapsulated in a Styled-Component with generated unique classNames, you'll be more than fine. It's much more intuitive, IMO.How did styled components even become popular?
RIP Styled-Components. Now What?
styled-components dead - alternatives or better way to achieve wanter results?
Styled-components entering maintenance mode
Videos
» npm install styled-components