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
I created one generic "styled-component". Here certain styles come dynamically via props. If the incoming value is like (bgColor="red"), I render directly.
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
-
Hi Everyone,
I created one generic "styled-component". Here certain styles come dynamically via props. If the incoming value is like (
bgColor="red"
), I render directly.What if the incoming value is object.
I'm grouping the values that come in the object one by one.
I create an output like this and return it to Styled-Component.
If you want to review my code: https://codesandbox.io/s/styled-components-object-props-pg4c30
My goal is for the style to be able to send initial, hover, focus, etc... values as an object via the prop.
I request you to review my code. I am open to all your thoughts. Please critique or edit my code based on your suggestion.
Thank you
Beta Was this translation helpful? Give feedback.
All reactions