From d02b2eecec40c0397fa5705321b8c4630002e9da Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Fri, 26 Feb 2021 21:17:33 +0530 Subject: [PATCH 1/3] Add snippet for react custom hook --- snippets/snippets.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 366092e..87bbe6d 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1850,5 +1850,17 @@ "}", "" ] - } + }, + "reactCustomHook": { + "prefix": "rch", + "body": [ + "import {$1} from 'react'", + "", + "export default function ${2:${TM_FILENAME_BASE}}($3) => {", + "\t$4", + "}", + "" + ], + "description": "Creates a React Custom Hook with ES7 module system" + } } From 92cd903f371037351502c1227ba480d7e6042772 Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:36:27 +0530 Subject: [PATCH 2/3] Fix indenting and syntax --- snippets/snippets.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 87bbe6d..3801c08 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1852,15 +1852,15 @@ ] }, "reactCustomHook": { - "prefix": "rch", - "body": [ - "import {$1} from 'react'", - "", - "export default function ${2:${TM_FILENAME_BASE}}($3) => {", - "\t$4", - "}", - "" - ], - "description": "Creates a React Custom Hook with ES7 module system" - } + "prefix": "rch", + "body": [ + "import {$1} from 'react'", + "", + "export default function ${2:${TM_FILENAME_BASE}}($3) {", + "\t$4", + "}", + "" + ], + "description": "Creates a React Custom Hook with ES7 module system" + }, } From 483fca3f797370e4e1b07d190f595d00a57dc55a Mon Sep 17 00:00:00 2001 From: Piyush <63099829+41y08h@users.noreply.github.com> Date: Sat, 27 Feb 2021 00:37:42 +0530 Subject: [PATCH 3/3] Fix json format --- snippets/snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 3801c08..eb08707 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1862,5 +1862,5 @@ "" ], "description": "Creates a React Custom Hook with ES7 module system" - }, + } }