Skip to content

Instantly share code, notes, and snippets.

@naoty
Last active September 5, 2018 06:15
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 naoty/2c720f602971c1979cdc3eca26c42129 to your computer and use it in GitHub Desktop.
Save naoty/2c720f602971c1979cdc3eca26c42129 to your computer and use it in GitHub Desktop.
VSCode snippet for react component in TypeScript
{
"Functional Component": {
"prefix": "_functional",
"body": [
"import * as React from \"react\";",
"",
"export default () => (",
" ${1:component}",
");"
]
},
"Class Component": {
"prefix": "_class",
"body": [
"import * as React from \"react\";",
"",
"export default class ${1:name} extends React.Component {",
" render() {",
" return (",
" ${2:component}",
" );",
" }",
"}"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment