Michael Landis
Jan 14, 2021

Styled Components creates dynamic classes by regenerating stylesheets on the fly.

When a class is created, the browser has to scan the entire document to identify which elements are associated with it. If the classes are generated statically beforehand, no full-document scanning is required. Only the modified element, its children, and perhaps its next siblings need to be scanned.

In terms of Styled Components being “the React way" and modular CSS not being so, I’m not sure there’s a consensus on that distinction.

I think we’ll have to agree to disagree on this. :-)

Michael Landis
Michael Landis

Written by Michael Landis

Front-end web developer, React enthusiast, vagabond.

No responses yet