Last active
November 16, 2022 02:41
-
-
Save ManfredHu/0673db54d09134da1041e781444c4725 to your computer and use it in GitHub Desktop.
rfc rfcd Auto to Create React Function Components
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": { | |
"prefix": "rfcd", | |
"body": [ | |
"import React, { FC } from 'react'", | |
"", | |
"interface ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Props {", | |
" $1", | |
"}", | |
"", | |
"const ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}: FC<${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Props> = ({ $2 }) => {", | |
" return (", | |
" <div>", | |
" ${3:$TM_FILENAME_BASE}", | |
" </div>", | |
" )", | |
"}", | |
"", | |
"export default ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g};" | |
] | |
}, | |
"Typescript React component": { | |
"prefix": "rfc", | |
"body": [ | |
"import React, { FC } from 'react'", | |
"", | |
"interface ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Props {", | |
" $1", | |
"}", | |
"", | |
"export const ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}: FC<${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}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