Skip to content

Instantly share code, notes, and snippets.

@vandersonarruda
Last active June 30, 2024 21:13
Show Gist options
  • Save vandersonarruda/a6928284c9128cbbe2c24f7b5e4b9439 to your computer and use it in GitHub Desktop.
Save vandersonarruda/a6928284c9128cbbe2c24f7b5e4b9439 to your computer and use it in GitHub Desktop.
{
// React Arrow Function Component
"React Arrow Function Component": {
"prefix": "aff",
"body": [
"const ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}} = () => {",
" return ( $3 )",
"}",
"",
"export default ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}}",
],
"description": "Creates a React Arrow Function Component"
},
// React Arrow Function
"React Arrow Function": {
"prefix": "eff",
"body": [
"export const ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}} = () => {",
" return ( $3 )",
"}",
],
"description": "Creates a React Arrow Function"
},
// React Function Component
"React Function Component": {
"prefix": "edf",
"scope": "typescript, typescriptreact",
"body": [
"export default function ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}}() {" ,
" return ( $3 )",
"}",
],
"description": "Creates a React Function Component"
},
// React Function Page
"React Function Page": {
"prefix": "edff",
"scope": "typescript, typescriptreact",
"body": [
"export default function ${1:${TM_DIRECTORY/.+[\\/](.*)/${1:/pascalcase}/}}Page() {",
" return ( $2 )",
"}",
],
"description": "Creates a React Function Component"
},
// Print to console
"Print to console": {
"prefix": "lg",
"body": [
"console.log($1)",
"$2"
],
"description": "Log output to console"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment