Skip to content

Instantly share code, notes, and snippets.

@tscritch
Created June 18, 2021 22:09
Show Gist options
  • Select an option

  • Save tscritch/87552833fe074726547a20235014abcb to your computer and use it in GitHub Desktop.

Select an option

Save tscritch/87552833fe074726547a20235014abcb to your computer and use it in GitHub Desktop.
VSCode React Snippets
{
"React State": {
"prefix": "rs",
"body": "const [$1, set${1/(.*)/${1:/capitalize}/}] = React.useState<$2>($3)",
"description": "React state statement"
},
"New React File": {
"prefix": "rf",
"body": [
"import React from 'react';",
"",
"interface Props {}",
"",
"const $1: React.FC<Props> = () => {",
" return $2",
"};",
"",
"export default $1;",
""
]
},
"React useEffect": {
"prefix": "rue",
"body": [
"React.useEffect(() => {",
" $1",
"}",
]
},
"React useEffect Async": {
"prefix": "ruea",
"body": [
"React.useEffect(() => {",
" (async () => {",
" $1",
" })()",
"}",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment