Created
April 6, 2022 11:14
-
-
Save kandros/4a7fc94c4386352c39e52510576edf14 to your computer and use it in GitHub Desktop.
typescriptreact vscode snippets
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
{ | |
"functional component": { | |
"prefix": ["func, fnc", "component", "fc", "func"], | |
"description": "react functional component", | |
"body": [ | |
"import React from 'react'", | |
"type Props = {}", | |
"export const $TM_FILENAME_BASE: React.FC<Props> = () => {", | |
"\treturn (", | |
"\t\t<div>", | |
"\t\t\t$TM_FILENAME_BASE$1", | |
"\t\t</div>", | |
"\t)", | |
"}" | |
] | |
}, | |
"useState": { | |
"prefix": "us", | |
"description": "React.useState", | |
"body": "const [$1, set${1/(.*)/${1:/capitalize}/}] = useState($2)" | |
}, | |
"useEffect": { | |
"prefix": "ue", | |
"description": "React.useEffect", | |
"body": ["useEffect(() => {", "\t$1", "},[$2])"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment