Skip to content

Instantly share code, notes, and snippets.

@maxboeck
Created February 24, 2019 17:33
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 maxboeck/0c8cd3753fecaf1a30db870663bfe81c to your computer and use it in GitHub Desktop.
Save maxboeck/0c8cd3753fecaf1a30db870663bfe81c to your computer and use it in GitHub Desktop.
{
"Create a stateless React component": {
"prefix": "scomp",
"description": "A stateless component",
"body": [
"import React from 'react'",
"import PropTypes from 'prop-types'",
"\nconst $1 = props => {",
"\treturn (",
"\t\t$0",
"\t)",
"}",
"\n$1.propTypes = {}",
"\nexport default $1"
]
},
"Create a React component": {
"prefix": "comp",
"description": "A React component",
"body": [
"import React from 'react'",
"import PropTypes from 'prop-types'",
"\nclass $1 extends React.Component {",
"\trender() {",
"\t\treturn (",
"\t\t\t$0",
"\t\t)",
"\t}",
"}",
"\n$1.propTypes = {}",
"\nexport default $1"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment