Created
October 16, 2018 20:09
-
-
Save randypitcherii/5ae545b17248cf983a6e7dcff844c966 to your computer and use it in GitHub Desktop.
VS Code javascript snippet for bootstrapping a new react component
This file contains hidden or 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
| { | |
| "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