From fe956b00e74fe66dd9f49a35f7cb4c4d0e180c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wouter=20Horr=C3=A9?= Date: Wed, 10 Jul 2019 14:26:31 +0200 Subject: [PATCH] Fix useEffect and useLayoutEffect snippets Moves the `${1:effect}` tabstop out of the returned function and adds `${2:cleanup}` tabstop inside the returned function. --- snippets/snippets.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 73ba6b1..2dd0f64 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1235,10 +1235,11 @@ "prefix": "useEffect", "body": [ "useEffect(() => {", + "\t${1:effect}", "\treturn () => {", - "\t\t${1:effect}", + "\t\t${2:cleanup}", "\t};", - "}, [${2:input}])" + "}, [${3:input}])" ] }, "useContext": { @@ -1290,10 +1291,11 @@ "prefix": "useLayoutEffect", "body": [ "useLayoutEffect(() => {", + "\t${1:effect}", "\treturn () => {", - "\t\t${1:effect}", + "\t\t${2:cleanup}", "\t},", - "\t[${2:input}]", + "\t[${3:input}]", "})" ] }