Created
January 19, 2019 19:37
-
-
Save intelliapps-io/de2d410acb3280ec746eda8e08f64b05 to your computer and use it in GitHub Desktop.
VS Code React Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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