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 6363 const value = useContext (myContext);
6464 ```
6565
66- 9 . ` rur ` (useRef hook)
66+ 9 . ` rucb ` (useCallback hook)
6767
6868 ``` jsx
69- const refContainer = useRef (initialValue );
69+ const handleCallback = useCallback (() => {}, [] );
7070 ```
7171
72+ 10 . ` rur ` (useRef hook)
73+
74+ ``` jsx
75+ const refContainer = useRef (initialValue);
76+ ```
77+
7278### TypeScript
7379
74801. ` rfcet` (React functional component)
103109 const value = useContext(myContext);
104110 ` ` `
105111
106- 5 . ` rurt ` (useRef hook)
112+ 5. ` rucbt` (useCallback hook)
113+
114+ ` ` ` jsx
115+ const handleCallback = useCallback(() => {}, []);
116+ ` ` `
117+
118+ 6. ` rurt` (useRef hook)
107119
108120 ` ` ` tsx
109121 const refContainer = useRef(initialValue);
Original file line number Diff line number Diff line change 4444 "body" : [" const ${1} = useContext(${2});" ],
4545 "description" : " JavaScript: useContext hook"
4646 },
47+ "rucb" : {
48+ "prefix" : " rucb" ,
49+ "body" : [
50+ " const handleCallback = useCallback(() => {" ,
51+ " \t $1" ,
52+ " }, [${2}]);"
53+ ],
54+ "description" : " JavaScript: useCallback hook"
55+ },
4756 "rur" : {
4857 "prefix" : " rur" ,
4958 "body" : [" const ${1} = useRef(${2});" ],
Original file line number Diff line number Diff line change 4747 "body" : [" const ${1} = useContext(${2});" ],
4848 "description" : " TypeScript: useContext hook"
4949 },
50+ "rucbt" : {
51+ "prefix" : " rucbt" ,
52+ "body" : [
53+ " const handleCallback = useCallback(() => {" ,
54+ " \t $1" ,
55+ " }, [${2}]);"
56+ ],
57+ "description" : " TypeScript: useCallback hook"
58+ },
5059 "rurt" : {
5160 "prefix" : " rurt" ,
5261 "body" : [" const ${1} = useRef(${2});" ],
You can’t perform that action at this time.
0 commit comments