Last active
July 12, 2021 23:38
-
-
Save jonasantonelli/f2737a58ed21533b40acb6394045236e to your computer and use it in GitHub Desktop.
Styled-Components - Wrapping a custom component
This file contains 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
import styled from 'styled-components' | |
/* | |
* Wrapping a custom component | |
*/ | |
const UnorderedList = styled(({ children, ...rest }) => ( | |
<ul {...rest}> | |
{ children } | |
</ul> | |
))` | |
list-style: none; | |
li { | |
margin-bottom: 7px; | |
} | |
` | |
export default () => ( | |
<UnorderedList> | |
<li>...<li> | |
</UnorderedList> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment