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
We use rebass with styled-components on our project. So we use the <Box /> and <Flex /> components a lot in our code.
When compiling, I get the following warning on the console:
Over 200 classes were generated for component styled.div with the id of "sc-AxjAm".
Consider using the attrs method, together with a style object for frequently changed styles.
Checking the elements reveal that the class name is used by the Box component, which gets different props to change the margins/paddings etc:
<Box mx={[5, 13]} my={7}>
<MyComponent />
</Box>
Can the Box and Flex components be refactored to use the attrs method? If there's another solution to this I'd gladly take it as well.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
We use rebass with styled-components on our project. So we use the
<Box />
and<Flex />
components a lot in our code.When compiling, I get the following warning on the console:
Checking the elements reveal that the class name is used by the
Box
component, which gets different props to change the margins/paddings etc:Can the
Box
andFlex
components be refactored to use theattrs
method? If there's another solution to this I'd gladly take it as well.Thanks in advance!
The text was updated successfully, but these errors were encountered: