Skip to content

Instantly share code, notes, and snippets.

@jonasantonelli
Last active July 12, 2021 23:38
Show Gist options
  • Save jonasantonelli/f2737a58ed21533b40acb6394045236e to your computer and use it in GitHub Desktop.
Save jonasantonelli/f2737a58ed21533b40acb6394045236e to your computer and use it in GitHub Desktop.
Styled-Components - Wrapping a custom component
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