File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 63
63
const value = useContext (myContext);
64
64
```
65
65
66
- 9 . ` rur ` (useRef hook)
66
+ 9 . ` rucb ` (useCallback hook)
67
67
68
68
``` jsx
69
- const refContainer = useRef (initialValue );
69
+ const handleCallback = useCallback (() => {}, [] );
70
70
```
71
71
72
+ 10 . ` rur ` (useRef hook)
73
+
74
+ ``` jsx
75
+ const refContainer = useRef (initialValue);
76
+ ```
77
+
72
78
### TypeScript
73
79
74
80
1. ` rfcet` (React functional component)
103
109
const value = useContext(myContext);
104
110
` ` `
105
111
106
- 5 . ` rurt ` (useRef hook)
112
+ 5. ` rucbt` (useCallback hook)
113
+
114
+ ` ` ` jsx
115
+ const handleCallback = useCallback(() => {}, []);
116
+ ` ` `
117
+
118
+ 6. ` rurt` (useRef hook)
107
119
108
120
` ` ` tsx
109
121
const refContainer = useRef(initialValue);
Original file line number Diff line number Diff line change 44
44
"body" : [" const ${1} = useContext(${2});" ],
45
45
"description" : " JavaScript: useContext hook"
46
46
},
47
+ "rucb" : {
48
+ "prefix" : " rucb" ,
49
+ "body" : [
50
+ " const handleCallback = useCallback(() => {" ,
51
+ " \t $1" ,
52
+ " }, [${2}]);"
53
+ ],
54
+ "description" : " JavaScript: useCallback hook"
55
+ },
47
56
"rur" : {
48
57
"prefix" : " rur" ,
49
58
"body" : [" const ${1} = useRef(${2});" ],
Original file line number Diff line number Diff line change 47
47
"body" : [" const ${1} = useContext(${2});" ],
48
48
"description" : " TypeScript: useContext hook"
49
49
},
50
+ "rucbt" : {
51
+ "prefix" : " rucbt" ,
52
+ "body" : [
53
+ " const handleCallback = useCallback(() => {" ,
54
+ " \t $1" ,
55
+ " }, [${2}]);"
56
+ ],
57
+ "description" : " TypeScript: useCallback hook"
58
+ },
50
59
"rurt" : {
51
60
"prefix" : " rurt" ,
52
61
"body" : [" const ${1} = useRef(${2});" ],
You can’t perform that action at this time.
0 commit comments