Skip to content

Instantly share code, notes, and snippets.

@andyperlitch
Created July 15, 2021 00:25
Show Gist options
  • Select an option

  • Save andyperlitch/6224ccc6bca4a4d3ef9a864e4f3f3e0b to your computer and use it in GitHub Desktop.

Select an option

Save andyperlitch/6224ccc6bca4a4d3ef9a864e4f3f3e0b to your computer and use it in GitHub Desktop.

Revisions

  1. andyperlitch created this gist Jul 15, 2021.
    23 changes: 23 additions & 0 deletions mui-component.code-snippets
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    {
    "MUI Component": {
    "scope": "typescriptreact",
    "prefix": "muicomp",
    "body": [
    "import { makeStyles \\} from '@material-ui/core/styles'",
    "",
    "const useStyles = makeStyles({",
    " root: {}",
    "}, { name: '${10:ComponentName}' })",
    "",
    "export interface ${10:ComponentName}Props {",
    " $30",
    "}",
    "export const ${10:ComponentName} = ({$35}: ${10:ComponentName}Props) => {",
    " const classes = useStyles()",
    " return ${40:<div className={classes.root\\}>$0</div>}",
    "\\}",
    "",
    "export default ${10:ComponentName}"
    ]
    }
    }