From 584194209194f88ba28cea044a568c00c117872e Mon Sep 17 00:00:00 2001 From: Mohith G Date: Mon, 22 May 2017 16:42:16 +0530 Subject: [PATCH 1/2] New snippet I mostly use this snippet when react and proptypes need not be imported --- snippets/snippets.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 8f1858d..ea084ac 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -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
\n\n\t\t\t$0
\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
\n\t\t\t$0\n\t\t
\n\t);\n};\n\nexport default ${1:componentName};", From e81b6db0199f08df85d67ae6f4a99c4ab189b5d6 Mon Sep 17 00:00:00 2001 From: Mohith G Date: Mon, 22 May 2017 16:46:55 +0530 Subject: [PATCH 2/2] Adjust spaces --- snippets/snippets.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index ea084ac..3ebd647 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -23,11 +23,11 @@ "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
\n\n\t\t\t$0
\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)" - }, + "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
\n\n\t\t\t$0
\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",