Skip to content

Instantly share code, notes, and snippets.

@intelliapps-io
Created January 19, 2019 19:37
Show Gist options
  • Save intelliapps-io/de2d410acb3280ec746eda8e08f64b05 to your computer and use it in GitHub Desktop.
Save intelliapps-io/de2d410acb3280ec746eda8e08f64b05 to your computer and use it in GitHub Desktop.
VS Code React Snippet
{
"TypeScript React Component Full": {
"prefix": "tsrcf",
"body": [
"import * as React from \"react\";",
"",
"interface IProps {",
"",
"}",
"",
"interface IState {",
"",
"}",
"",
"class ${TM_FILENAME_BASE} extends React.Component<IProps, IState> {",
"\tconstructor(props: IProps) {",
"\t\tsuper(props);",
"\t};",
"",
"\trender() {",
"\t\treturn(",
"\t\t\t<div>",
"\t\t\t\t<h2>${TM_FILENAME_BASE}</h2>",
"\t\t\t</div>",
"\t\t);",
"\t};",
"}",
"",
"export default ${TM_FILENAME_BASE};"
]
},
"TypeScript React Component Simple": {
"prefix": "tsrcs",
"body": [
"import * as React from \"react\";",
"",
"interface IProps {",
"",
"}",
"",
"class ${TM_FILENAME_BASE} extends React.Component<IProps> {",
"\trender() {",
"\t\treturn(",
"\t\t\t<div>",
"\t\t\t\t<h2>${TM_FILENAME_BASE}</h2>",
"\t\t\t</div>",
"\t\t);",
"\t};",
"}",
"",
"export default ${TM_FILENAME_BASE};"
]
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment