Last active
March 1, 2023 06:54
-
-
Save sohamsshah/8f2da94796441817f40aa65e35e79ac0 to your computer and use it in GitHub Desktop.
Custom React Code Snippet for VSCode
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
{ | |
"reactArrowFunctionComponentWithDisplayName": { | |
"prefix": "rafcd", | |
"body": [ | |
"export const ${1:${TM_FILENAME_BASE}} = () => {", | |
" return (", | |
" <div>${1:first}</div>", | |
" )", | |
"}", | |
"", | |
"${1:${TM_FILENAME_BASE}}.displayName = '${1:${TM_FILENAME_BASE}}'", | |
], | |
"description": "Creates a React Arrow Function Component with ES7 module system with display name for debugging purposes", | |
"scope": "typescript,typescriptreact,javascript,javascriptreact" | |
}, | |
"typescriptReactArrowFunctionComponent": { | |
"prefix": "tsrafcd", | |
"body": [ | |
"type Props = {}", | |
"", | |
"const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", | |
" return (", | |
" <div>${1:first}</div>", | |
" )", | |
"}", | |
"", | |
"${1:${TM_FILENAME_BASE}}.displayName = '${1:${TM_FILENAME_BASE}}'", | |
], | |
"description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface with display name for debugging purposes", | |
"scope": "typescript,typescriptreact,javascript,javascriptreact" | |
}, | |
"typescriptReactFunctionalComponentWithDisplayName": { | |
"prefix": "tsrfcd", | |
"body": [ | |
"type Props = {}", | |
"", | |
"export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", | |
" return (", | |
" <div>${1:first}</div>", | |
" )", | |
"}", | |
"", | |
"${1:${TM_FILENAME_BASE}}.displayName = '${1:${TM_FILENAME_BASE}}'", | |
], | |
"description": "Creates a React Functional Component with ES7 module system and TypeScript interface with display name for debugging purposes", | |
"scope": "typescript,typescriptreact,javascript,javascriptreact" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment