Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TypeScript VSCode snippet
{
"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
You can’t perform that action at this time.