Skip to content

Instantly share code, notes, and snippets.

@randypitcherii
Created October 16, 2018 20:09
Show Gist options
  • Select an option

  • Save randypitcherii/5ae545b17248cf983a6e7dcff844c966 to your computer and use it in GitHub Desktop.

Select an option

Save randypitcherii/5ae545b17248cf983a6e7dcff844c966 to your computer and use it in GitHub Desktop.
VS Code javascript snippet for bootstrapping a new react component
{
"New Component": {
"prefix": "newComponent",
"body": [
"import React, { Component } from 'react';",
"",
"import { withStyles } from '@material-ui/core/styles';",
"",
"const styles = {",
"\t//customStyle: {",
"\t\t//position: 'absolute',",
"\t//},",
"};",
"",
"class ${1:MyComponent} extends Component {",
"\tstate = {",
"\t\tfoo: true,",
"\t\tbar: false,",
"\t};",
"",
"\trender() {",
"\t}",
"}",
"",
"export default withStyles(styles)(${1});",
],
"description": "Starting point for a new component"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment