Skip to content

Commit

Permalink
Merge pull request #25 from mohithg/patch-2
Browse files Browse the repository at this point in the history
New snippet
  • Loading branch information
xabikos authored Jun 26, 2017
2 parents b3abee1 + e81b6db commit a06d91d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"description": "Creates a React component class with PropTypes and all lifecycle methods and ES6 module system"
},

"reactWithWebpackDefaults": {
"prefix": "rwwd",
"body": "class ${1:componentName} extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\n\t\tthis.state = {};\n\n\t}\n\n\trender() {\n\t\treturn(\n\t\t\t<div>\n\n\t\t\t$0</div>\n\t\t);\n\t}\n}\n\n${1:componentName}.propTypes = {\n\n};\n\nexport default ${1:componentName};",
"description": "Creates a React component class with constructor, empty state, proptypes and export in ES6 module system without imports. (Mostly used when React, Proptypes are provided by webpack provide plugin)"
},

"reactStateless": {
"prefix": "rsc",
"body": "import React from 'react';\n\nconst ${1:componentName} = () => {\n\treturn (\n\t\t<div>\n\t\t\t$0\n\t\t</div>\n\t);\n};\n\nexport default ${1:componentName};",
Expand Down

0 comments on commit a06d91d

Please sign in to comment.