Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4b9e7e1

Browse files
wouterrodeynsDamian Sznajder
authored and
Damian Sznajder
committed
Fix useEffect and useLayoutEffect snippets
Moves the `${1:effect}` tabstop out of the returned function and adds `${2:cleanup}` tabstop inside the returned function.
1 parent c615ab3 commit 4b9e7e1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎snippets/snippets.json‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,11 @@
12351235
"prefix": "useEffect",
12361236
"body": [
12371237
"useEffect(() => {",
1238+
"\t${1:effect}",
12381239
"\treturn () => {",
1239-
"\t\t${1:effect}",
1240+
"\t\t${2:cleanup}",
12401241
"\t};",
1241-
"}, [${2:input}])"
1242+
"}, [${3:input}])"
12421243
]
12431244
},
12441245
"useContext": {
@@ -1290,10 +1291,11 @@
12901291
"prefix": "useLayoutEffect",
12911292
"body": [
12921293
"useLayoutEffect(() => {",
1294+
"\t${1:effect}",
12931295
"\treturn () => {",
1294-
"\t\t${1:effect}",
1296+
"\t\t${2:cleanup}",
12951297
"\t},",
1296-
"\t[${2:input}]",
1298+
"\t[${3:input}]",
12971299
"})"
12981300
]
12991301
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /