Last active
September 5, 2018 06:15
-
-
Save naoty/2c720f602971c1979cdc3eca26c42129 to your computer and use it in GitHub Desktop.
VSCode snippet for react component in TypeScript
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
{ | |
"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