Created
May 5, 2020 20:04
-
-
Save doublejosh/c8b5caf4cda2369ffdc572e79e8cd4fd to your computer and use it in GitHub Desktop.
Typescript + MUI + Styled
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
const MyComponent: React.FC<{ theme: MyTheme }> = styled(({ theme, ...props }) => <Box {...props} />)` | |
&& { | |
text-align: center; | |
padding-top: ${props => props.theme.spacing(2)}px; | |
} | |
` | |
export const Wrapper: React.FC<WrapperProps> = ({ ...props }) => { | |
const theme: MyTheme = useTheme() | |
return ( | |
<MyComponent theme={theme}> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment