Skip to content

Instantly share code, notes, and snippets.

@davidalves1
Last active October 5, 2018 21:33
Show Gist options
  • Save davidalves1/9677ab859ece0a7fb9da879f7cdbd7de to your computer and use it in GitHub Desktop.
Save davidalves1/9677ab859ece0a7fb9da879f7cdbd7de to your computer and use it in GitHub Desktop.
VS Code React Snippets
{
"React_Base_Component": {
"prefix": "rbc",
"body": [
"import React from \"react\";",
"import PropTypes from \"prop-types\";",
"\nimport style from \"./style.css\";\n",
"class $1 extends React.Component {",
"\tconstructor() {",
"\t\tsuper();",
"\t}\n",
"\trender() {",
"\t\treturn (\n\t\t\t<h1>$1</h1>\n\t\t);\n\t}\n}",
"\n$1.propTypes = {",
"\t\n}",
"\nexport default $1;"
],
"description": "Create a react base component"
},
"React_Base_Component_Redux": {
"prefix": "rbcr",
"body": [
"import React from \"react\";",
"import PropTypes from \"prop-types\";",
"import { bindActionCreators } from \"redux\";",
"import { connect } from \"react-redux\";",
"\nimport style from \"./style.css\";\n",
"class $1 extends React.Component {",
"\tconstructor(props) {",
"\t\tsuper(props);",
"\t}\n",
"\trender() {",
"\t\treturn (\n\t\t\t<h1>$1</h1>\n\t\t);\n\t}\n}",
"\n$1.propTypes = {",
"\t\n}\n",
"const mapStateToProps = store => ({\n\t\n});\n",
"const mapDispatchToProps = dispatch => bindActionCreators({\n\t\n}, dispatch);\n",
"export default connect(mapStateToProps, mapDispatchToProps)($1);"
],
"description": "Create a react base component with redux"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment