Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// import
"section-1": "IMPORTS",
"ES6 React Import": {
"prefix": "imr",
"body": "import React from 'react'\n"
Expand All @@ -20,7 +20,7 @@
"prefix": "imc",
"body": "import ${1:componentName} from './components/${1:componentName}'\n"
},
// React
"section-2": "REACT",
"reactClassCompoment": {
"prefix": "rcc",
"body": "import React, { Component } from 'react'\n\nexport default class ${1:componentName} extends Component {\n\trender() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t$0\n\t\t\t</div>\n\t\t)\n\t}\n}\n",
Expand Down Expand Up @@ -321,7 +321,12 @@
"body": "PropTypes.shape({\n\t$0\n}).isRequired,",
"description": "An object taking on a particular shape required"
},
// Redux
"reactStateHook": {
"prefix": "rhk",
"body": "const [count, setCount] = React.useState(0)",
"description": "declare a new state variable using hooks"
},
"section-3": "REDUX",
"Import reselect": {
"prefix": "imcreateSelector",
"body": "import { createSelector } from 'reselect'\n",
Expand Down Expand Up @@ -380,7 +385,7 @@
],
"description": "Redux selector."
},
// react-redux
"section-4": "REACT-REDUX",
"Connect Redux": {
"prefix": "imconnect",
"body": "import { connect } from 'react-redux'\n"
Expand Down Expand Up @@ -442,7 +447,7 @@
],
"description": "Redux container"
},
// react-router
"section-5": "REACT-ROUTER",
"ES6 react-router Import": {
"prefix": "imrr",
"body": [
Expand Down Expand Up @@ -476,7 +481,6 @@
"prefix": "navlink",
"body": "<NavLink to={${1:path}}>{$anchorText}</NavLink>\n"
},
// comment block
"Comment Block": {
"prefix": "cmmb",
"body": [
Expand Down