Last active
October 14, 2022 12:54
-
-
Save danielbellmas/b842c5c6342425dbcd17a338cba1d4b6 to your computer and use it in GitHub Desktop.
Visual Studio Code Snippets for a Typescript React component
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
"Typescript default React component": { | |
"scope": "typescriptreact", | |
"prefix": "rfcd", | |
"body": [ | |
"import React, { FC } from 'react'", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" $1", | |
"}", | |
"", | |
"const ${TM_FILENAME_BASE}: FC<${TM_FILENAME_BASE}Props> = ({ $2 }) => {", | |
" return (", | |
" <div>", | |
" ${3:$TM_FILENAME_BASE}", | |
" </div>", | |
" )", | |
"}", | |
"", | |
"export default ${TM_FILENAME_BASE};" | |
], | |
}, | |
"Typescript React component": { | |
"scope": "typescriptreact", | |
"prefix": "rfc", | |
"body": [ | |
"import React, { FC } from 'react'", | |
"", | |
"interface ${TM_FILENAME_BASE}Props {", | |
" $1", | |
"}", | |
"", | |
"export const ${TM_FILENAME_BASE}: FC<${TM_FILENAME_BASE}Props> = ({ $2 }) => {", | |
" return (", | |
" <div>", | |
" ${3:$TM_FILENAME_BASE}", | |
" </div>", | |
" )", | |
"}", | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment