Created
March 12, 2019 12:40
-
-
Save jgcmarins/0e7a92eea418b509b17fd2e56ad6a23c to your computer and use it in GitHub Desktop.
Do not emit warning when using styled-components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// do not emit warning | |
const StyledIcon = styled(({ isOpen, ...rest }) => <Icon {...rest} />)` | |
margin-left: ${props => (props.isOpen ? 0 : 1)}px; | |
font-size: 14px !important; | |
color: ${props => props.theme.primaryBackgroundColor}; | |
`; | |
// emit warning | |
const StyledIcon = styled(Icon)<{ isOpen: boolean }>` | |
margin-left: ${props => (props.isOpen ? 0 : 1)}px; | |
font-size: 14px !important; | |
color: ${props => props.theme.primaryBackgroundColor}; | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment