/
my-custom-snippet.json
62 lines (62 loc) · 1.63 KB
/
my-custom-snippet.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
"Base Component Template": {
"prefix": "rtc",
"body": [
"const ${1:$TM_FILENAME_BASE} = () => {",
"return <>",
"\t$0",
"</>",
"}",
"\nexport default ${1:$TM_FILENAME_BASE}"
],
"description": "Base React component with no props, imports or types"
},
"Typed Component": {
"prefix": "rttc",
"body": [
"const ${1:$TM_FILENAME_BASE}:React.FC = ({children}) => {",
"return <>",
"\t$0",
"</>",
"}",
"\nexport default ${1:$TM_FILENAME_BASE}"
],
"description": "Base React component with no props, but with children components"
},
"Component With Props": {
"prefix": "rtcp",
"body": [
"interface I${1:$TM_FILENAME_BASE}Props {",
"\t$2",
"}",
"\nconst ${1:$TM_FILENAME_BASE}:React.FC<I${1:$TM_FILENAME_BASE}Props> = ({$3}) => {",
"return <>",
"\t$0",
"</>",
"}",
"\nexport default ${1:$TM_FILENAME_BASE}"
],
"description": "React component with props and interface definition templates"
},
"Custom Hook": {
"prefix": "ch",
"body": [
"const use${1:$TM_FILENAME_BASE} = () => {",
"\t$0",
"return true",
"}",
"\nexport default use${1:$TM_FILENAME_BASE}"
],
"description": "Basic custom hook"
},
"Component Interface": {
"prefix": "ri",
"body": ["interface I${1:$TM_FILENAME_BASE}Props {", "\t$2", "}"],
"description": "Interface definition for react component"
},
"Basic useEffect hook": {
"prefix": "ueh",
"body": ["useEffect(() => {$1}, [$2])"],
"description": "Basic useEffect hook without return function"
}
}