Created
June 18, 2021 22:09
-
-
Save tscritch/87552833fe074726547a20235014abcb to your computer and use it in GitHub Desktop.
VSCode React Snippets
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 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