Created
May 19, 2018 04:55
-
-
Save velopert/fa5140208ddc2d71932478952434ded7 to your computer and use it in GitHub Desktop.
TypeScript VSCode snippet
This file contains hidden or 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
{ | |
"Create Stateless component": { | |
"prefix": "rsc", | |
"body": [ | |
"import * as React from 'react';", | |
"", | |
"interface ${1:${TM_FILENAME_BASE}}Props {", | |
" someProps: boolean;", | |
"}", | |
"", | |
"const ${1:${TM_FILENAME_BASE}}: React.SFC<${1:${TM_FILENAME_BASE}}Props> = () => {", | |
" return <div>${1:${TM_FILENAME_BASE}}</div>;", | |
"};", | |
"", | |
"export default ${1:${TM_FILENAME_BASE}};", | |
"" | |
], | |
"description": "" | |
}, | |
"Create React Class Component": { | |
"prefix": "rcc", | |
"body": [ | |
"import * as React from 'react';", | |
"", | |
"interface ${1:${TM_FILENAME_BASE}}Props {", | |
" someValue: boolean;", | |
"}", | |
"", | |
"class ${1:${TM_FILENAME_BASE}} extends React.Component {", | |
" public render() {", | |
" return (", | |
" <div>${1:${TM_FILENAME_BASE}}</div>", | |
" );", | |
" }", | |
"}", | |
"", | |
"export default ${1:${TM_FILENAME_BASE}};" | |
], | |
"description": "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment