Skip to content

Instantly share code, notes, and snippets.

@vandersonarruda
Last active August 2, 2024 23:34
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": "affc",
"body": [
"export const ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}} = () => {",
" return ( $3 )",
"}",
],
"description": "Creates a React Arrow Function Component"
},
// React Arrow Function
"React Arrow Function": {
"prefix": "aff",
"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": "effc",
"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": "eff",
"scope": "typescript, typescriptreact",
"body": [
"export default function ${1:${TM_DIRECTORY/.+[\\/](.*)/${1:/pascalcase}/}}Page() {",
" return ( $2 )",
"}",
],
"description": "Creates a React Function Component"
},
// Export const
"Export const": {
"prefix": "ec",
"body": [
"export const ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/downcase}${2:/downcase}/g}}",
],
"description": "Export const"
},
// Export class
"Export class": {
"prefix": "ecc",
"body": [
"export class ${0:${TM_FILENAME_BASE/(\\w)(\\w*)|(\\W)/${1:/upcase}${2:/downcase}/g}} {",
"$2",
"}"
],
"description": "Export class"
},
// Export async function
"Export async function": {
"prefix": "ef",
"body": [
"export async function ${TM_FILENAME_BASE/^([a-zA-Z])|-(.)/${1:/downcase}${2:/upcase}/g}() {",
"$2",
"}"
],
"description": "Export async function"
},
// 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