-
Notifications
You must be signed in to change notification settings - Fork 0
/
typescriptreact.json
45 lines (45 loc) · 984 Bytes
/
typescriptreact.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
{
"Create Next Client Component": {
"prefix": "nc", // The trigger keyword
"body": [
"\"use client\";",
"export default function ${1}() {",
" return (",
" <>",
" ${2}",
" </>",
" )",
"}"
],
"description": "Create a React functional component with TypeScript"
},
"Create Next Server Component": {
"prefix": "ns", // The trigger keyword
"body": [
"export default async function Page() {",
" return (",
" <>",
" ${1}",
" </>",
" )",
"}"
],
"description": "Create a React functional component with TypeScript"
},
"Create State": {
"prefix": "state", // The trigger keyword
"body": [
"const [${1:state}, set${1/(^.*)/${1:/capitalize}/}] = useState(${2});"
],
"description": "Create a React state"
},
"Create Effect": {
"prefix": "effect", // The trigger keyword
"body": [
"useEffect(()=>{",
" ${1}",
"}, [${2}]);"
],
"description": "Create a React effect"
}
}