loading...

re: Extend usage of styled-components in React VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Yes, you can use that in some cases. But some times, it doesn't necessary to create another component extended from another component. I'm not even...
 

Well, if you don't want to add another SC component, you can just inline styles like in regular react component without introducing extra styles prop:

<MyButton style={{fontSize: '2rem'}}>hi</MyButton>

That's another point (:
It will increase the React's run-time.
Because it will be added as inline-styles in HTML tag.
But if you pass this style props into the body of styled-component, it will be used in build-time.

Code of Conduct Report abuse