Created
October 5, 2020 21:45
-
-
Save brookslybrand/10113016f609a3f5a562cdfbb56f66bc to your computer and use it in GitHub Desktop.
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
// styled component version | |
const Container = styled.div` | |
/*all of the styles*/ | |
` | |
function MyComponent() { | |
return <Container>{/*other stuff*/}</Container> | |
} | |
// css prop version | |
function MyComponent() { | |
return ( | |
<div css={css` | |
/*all of the styles*/ | |
`}> | |
{/*other stuff*/} | |
</div> | |
) | |
} | |
// if you really want you can move the css declaration below or in a different file | |
function MyComponent() { | |
return ( | |
<div css={containerCss}> | |
{/*other stuff*/} | |
</div> | |
) | |
} | |
const containerCss = css` | |
/*all of the styles*/ | |
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment