-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact.yaml
More file actions
47 lines (36 loc) · 1.21 KB
/
react.yaml
File metadata and controls
47 lines (36 loc) · 1.21 KB
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
useState:
body: const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initialState});
prefix: useState
useCallback:
body: "useCallback(\t() => {\t\t${1:callback}\t},\t[${2:input}],)"
prefix: useCallback
useContext:
body: const ${1:context} = useContext(${2:contextValue})
prefix: useContext
useDebugValue:
body: useDebugValue(${1:value})
prefix: useDebugValue
useDispatch:
body: const dispatch = useDispatch(${1:function})
prefix: useDispatch
useEffect:
body: "useEffect(() => {\t${1:effect}\treturn () => {\t\t${2:cleanup}\t}}, [${3:input}])"
prefix: useEffect
useImperativeHandle:
body: "useImperativeHandle(\t${1:ref},\t() => {\t\t${2:handler}\t},\t[${3:input}],)"
prefix: useImperativeHandle
useLayoutEffect:
body: "useLayoutEffect(() => {\t${1:effect}\treturn () => {\t\t${2:cleanup}\t};}, [${3:input}])"
prefix: useLayoutEffect
useMemo:
body: useMemo(() => ${1:function}, ${2:input})
prefix: useMemo
useRef:
body: const ${1:ref} = useRef(${2:initialValue})
prefix: useRef
useSelector:
body: const ${1:state} = useSelector(state => state.${1:state})
prefix: useSelector
import React, { Component }:
body: import React, { Component } from 'react'
prefix: imrc