-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change 'too many classes' error to recommend attrs for frequently changed styles #1213
Change 'too many classes' error to recommend attrs for frequently changed styles #1213
Conversation
Generated by 🚫 dangerJS |
console.warn(`Over ${LIMIT} classes were generated for component ${displayName}. ` + | ||
'Consider using style property for frequently changed styles.\n' + | ||
console.warn(`Over ${LIMIT} classes were generated for component ${displayName}. \n` + | ||
'Consider using the attrs property, together with a style object for frequently changed styles.\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*attrs property => method
Otherwise lgtm :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @lukebelliveau, thank you for all these contributions! One tiny nitpick then we'll ship this 👌
' const StyledComp = styled.div`width: 100%;`\n' + | ||
' <StyledComp style={{ background: background }} />') | ||
' const Component = styled.div.attrs({\n' + | ||
' style: ({ background }) => {\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a pair of parenthesis missing here:
style: ({ background }) => {
background,
}
// should be
style: ({ background }) => ({
background,
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks so much!
No description provided.