Skip to content

Commit 4767e68

Browse files
committed
Add useImperativeHandle hook snippet
1 parent 90c4516 commit 4767e68

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ React Hooks Snippets is a [Visual Studio Code](https://code.visualstudio.com/) e
1818
| `umh` | `useMemo` |
1919
| `irh` | `import React` (and common hooks) |
2020
| `urh` | `useRef` |
21+
| `uihh` | `useImperativeHandle` |
2122
| `urdh` | `useReducer` |
2223
| `irrh` | import react redux hooks |
2324
| `uss` | `useSelector` |

snippets/snippets.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@
5757
],
5858
"description": "React useRef() hook"
5959
},
60+
"useImperativeHandle": {
61+
"prefix": "uihh",
62+
"body": [
63+
"useImperativeHandle(ref, () => {",
64+
"\treturn {",
65+
"\t\t$1",
66+
"\t}",
67+
"}, [$2]);$0"
68+
],
69+
"description": "React useImperativeHandle() hook"
70+
},
6071
"useReducer": {
6172
"prefix": "urdh",
6273
"body": [

0 commit comments

Comments
 (0)