Skip to content

Instantly share code, notes, and snippets.

@edujtm
Created March 24, 2019 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edujtm/c17225891d50318ef28df4a1950023a6 to your computer and use it in GitHub Desktop.
Save edujtm/c17225891d50318ef28df4a1950023a6 to your computer and use it in GitHub Desktop.
Some VS Code snippets for React.
{
"Create Reducer Template": {
"prefix": "rreducer",
"body": [
"const INITIAL_STATE = {};",
"",
"export default (state = INITIAL_STATE, action) => {",
" switch (action.type) {",
" default:",
" return state;",
" }",
"};"
],
"description": "Small template for reducers"
},
"Create stateful component": {
"prefix": "fulComponent",
"body": [
"import React, { Component } from 'react';",
"",
"class ${1:className} extends Component {",
" render() {",
" return (",
" ",
" );",
" }",
"}",
"",
"export default ${className};"
],
"description": "Create a stateful react component"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment