From 9a4463ef48402db70c5e81aaa169e0ef46a0f3d4 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 10 May 2018 20:42:02 -0700 Subject: [PATCH 1/4] Add named function options --- snippets/snippets.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 1bd969f..2547720 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -51,6 +51,16 @@ "body": "import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ${1:${TM_FILENAME_BASE}} = props => {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n};\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\t$0\n};\n\nexport default ${1:${TM_FILENAME_BASE}};", "description": "Creates a stateless React component with PropTypes and ES6 module system" }, + "reactStatelessFunction": { + "prefix": "rsf", + "body": "import React from 'react';\n\nfunction ${1:${TM_FILENAME_BASE}(props) {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Creates a stateless React component as a named function without PropTypes" + }, + "reactStatelessFunctionProps": { + "prefix": "rsf", + "body": "import React from 'react';\nimport PropTypes from 'prop-types';\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\t$0\n};\n\nfunction ${1:${TM_FILENAME_BASE}(props) {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\nexport default ${1:${TM_FILENAME_BASE}};", + "description": "Creates a stateless React component as a named function with PropTypes" + }, "classConstructor": { "prefix": "con", From ded12cb14ddb92eb274b137f77591205d6ecf3e7 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 10 May 2018 23:49:47 -0700 Subject: [PATCH 2/4] Correct typo --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 2547720..f6b029c 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -57,7 +57,7 @@ "description": "Creates a stateless React component as a named function without PropTypes" }, "reactStatelessFunctionProps": { - "prefix": "rsf", + "prefix": "rsfp", "body": "import React from 'react';\nimport PropTypes from 'prop-types';\n\n${1:${TM_FILENAME_BASE}}.propTypes = {\n\t$0\n};\n\nfunction ${1:${TM_FILENAME_BASE}(props) {\n\treturn (\n\t\t
\n\t\t\t\n\t\t
\n\t);\n}\n\nexport default ${1:${TM_FILENAME_BASE}};", "description": "Creates a stateless React component as a named function with PropTypes" }, From c1a3d5b26a1a1cd90444c906cf77d3a01859f77d Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 10 May 2018 23:51:42 -0700 Subject: [PATCH 3/4] Update README.md with new snippets --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 59df9a2..1565d5b 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,9 @@ Below is a list of all available snippets and the triggers of each one. The ** | `rpc→` | class pure component skeleton with prop types after the class | | `rsc→` | stateless component skeleton | | `rscp→` | stateless component with prop types skeleton | -| `rpt→` | empty propTypes declaration | +| `rsf→` | stateless named function skeleton | +| `rsfp→` | stateless named function with prop types skeleton | +| `rpt→`   | empty propTypes declaration | | `rdp→` | empty defaultProps declaration | | `con→` | class default constructor with props| | `conc→` | class default constructor with props and context | From cdb1d280494af2011cd7141887ad57e173c75593 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 10 May 2018 23:52:10 -0700 Subject: [PATCH 4/4] Remove extra space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1565d5b..afca872 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Below is a list of all available snippets and the triggers of each one. The ** | `rsc→` | stateless component skeleton | | `rscp→` | stateless component with prop types skeleton | | `rsf→` | stateless named function skeleton | -| `rsfp→` | stateless named function with prop types skeleton | +| `rsfp→` | stateless named function with prop types skeleton | | `rpt→`   | empty propTypes declaration | | `rdp→` | empty defaultProps declaration | | `con→` | class default constructor with props|