You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone! I'm trying to learn more about how styled components work. Currently, I'm trying to understand how styles that render based on props. Concretely, let's say I have something like this:
and I press the random margin button a few times. I'm wondering:
Would this create a new class for my rendered <InnerContainer /> each time? Or would somehow edit the marginRight of the one class directly (via something like document.styleSheets[0].cssRules[0].style.marginRight = ... for example)?
If it creates a new class instead of editing the class, does it remove the old class? Ie, if I press the button 5 times would all 6 (the original, + 5 new ones) class definitions still exist, or just the one currently in use?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone! I'm trying to learn more about how styled components work. Currently, I'm trying to understand how styles that render based on props. Concretely, let's say I have something like this:
and I press the
random margin
button a few times. I'm wondering:<InnerContainer />
each time? Or would somehow edit the marginRight of the one class directly (via something likedocument.styleSheets[0].cssRules[0].style.marginRight = ...
for example)?Beta Was this translation helpful? Give feedback.
All reactions