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
"React Component": { | |
"prefix": "react#component", | |
"body": [ | |
"export type ${1/(.*)/${1:/capitalize}Props/} = {};", | |
"export const ${1/(.*)/${1:/capitalize}/} = (props: ${1/(.*)/${1:/capitalize}Props/}) => {", | |
" return (", | |
" $2", | |
" );", | |
"};" | |
], |
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
"React Component using filename": { | |
"prefix": "react#component-use-filename", | |
"body": [ | |
"export const ${TM_FILENAME_BASE/(.*)/${1:/capitalize}/} = (props) => {", | |
" return (", | |
" $2", | |
" );", | |
"};" | |
], | |
"description": "Create a functional React component based on the filename" |
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
"React Component": { | |
"prefix": "react#component", | |
"body": [ | |
"export const ${1/(.*)/${1:/capitalize}/} = (props) => {", | |
" return (", | |
" $2", | |
" );", | |
"};" | |
], | |
"description": "Create a functional 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
"React useRef": { | |
"prefix": "react#useRef", | |
"body": [ | |
"const ${1:ref} = useRef<$2 | null>(${3:null});" | |
], | |
"description": "React useRef for TypeScript" | |
} |
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
"React useRef": { | |
"prefix": "react#useRef", | |
"body": [ | |
"const ${1:ref} = useRef(${2:null});" | |
], | |
"description": "React useRef" | |
} |
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
"React useEffect": { | |
"prefix": "react#useEffect", | |
"body": [ | |
"useEffect(() => {", | |
" $1", | |
"}, [$2]);" | |
], | |
"description": "React useEffect" | |
} |
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
"React useState with typings": { | |
"prefix": "react#useState", | |
"body": "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = useState<$3 | null>(null);", | |
"description": "React useState with typings" | |
} |
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
"React useState": { | |
"prefix": "react#useState", | |
"body": "const [${1}, set${1/(^[a-zA-Z])(.*)/${1:/upcase}${2}/}] = useState(null);", | |
"description": "React useState" | |
} |
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
"Named function with typings": { | |
"prefix": "ts#function", | |
"body": [ | |
"export type $1Params = {};", | |
"function $1(params: $1Params) {", | |
" $2", | |
"}" | |
], | |
"description": "Create a named function with typings" | |
} |
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
"Named function using filename": { | |
"prefix": "js#function-use-filename", | |
"body": [ | |
"function ${1:${TM_FILENAME_BASE}}(${2:params}) {", | |
" $3", | |
"}" | |
], | |
"description": "Create a named function with filename as the default function name" | |
} |