Skip to content

Instantly share code, notes, and snippets.

@madflanderz
Last active March 7, 2019 09:31
Show Gist options
  • Save madflanderz/0ed0c39664b7c7cc0bf468f1ef8982fe to your computer and use it in GitHub Desktop.
Save madflanderz/0ed0c39664b7c7cc0bf468f1ef8982fe to your computer and use it in GitHub Desktop.
React Component Material UI
import * as React from 'react'
import { Theme } from '@material-ui/core/styles'
import { makeStyles } from '@material-ui/styles';
const useStyles = makeStyles(({ palette }: Theme) => ({
root: {
// backgroundColor: palette.primary,
},
}),
{ name: 'MyComponent' }
)
interface Props {
title: string
}
const MyComponent = ({title}: Props) => {
const c = useStyles()
return <div className={c.root}></div>
}
export default MyComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment