From b0db9eea5f4802e58a15594324a32f59fa189800 Mon Sep 17 00:00:00 2001 From: Sabin Baniya Date: Fri, 11 Feb 2022 19:37:15 +0545 Subject: [PATCH 1/3] Next js get static path add --- snippets/next-javascript.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/snippets/next-javascript.json b/snippets/next-javascript.json index 80998a0..f470736 100644 --- a/snippets/next-javascript.json +++ b/snippets/next-javascript.json @@ -20,5 +20,17 @@ "};" ], "description": "Next.js Get Static Props Typescript" - } + }, + "ngsp": { + "prefix": "ngsp", + "body": [ + "export const getStaticPaths = async () => {", + " return {", + " paths:[${1}],", + " fallback:false", + " }", + "}" + ], + "description": "Next JS Get Static Path Javascript" +} } From d3fd4c9e833aa1b364646fe91e90ee2775fd6ed4 Mon Sep 17 00:00:00 2001 From: Sabin Baniya Date: Fri, 11 Feb 2022 19:39:30 +0545 Subject: [PATCH 2/3] Next js get static path add --- snippets/next-javascript.json | 22 +++++++++++----------- snippets/next-typescript.json | 12 ++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/snippets/next-javascript.json b/snippets/next-javascript.json index f470736..83f6c98 100644 --- a/snippets/next-javascript.json +++ b/snippets/next-javascript.json @@ -22,15 +22,15 @@ "description": "Next.js Get Static Props Typescript" }, "ngsp": { - "prefix": "ngsp", - "body": [ - "export const getStaticPaths = async () => {", - " return {", - " paths:[${1}],", - " fallback:false", - " }", - "}" - ], - "description": "Next JS Get Static Path Javascript" -} + "prefix": "ngsp", + "body": [ + "export const getStaticPaths = async () => {", + " return {", + " paths:[${1}],", + " fallback:false", + " }", + "}" + ], + "description": "Next.js Get Static Path Javascript" + } } diff --git a/snippets/next-typescript.json b/snippets/next-typescript.json index 1c70431..38c0ec0 100644 --- a/snippets/next-typescript.json +++ b/snippets/next-typescript.json @@ -67,5 +67,17 @@ "export default ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}" ], "description": "Next.js Component Typescript" + }, + "ngspt": { + "prefix": "ngspt", + "body": [ + "export const getStaticPaths: GetStaticPaths = async () => {", + " return {", + " paths:[${1}],", + " fallback:false", + " }", + "}" + ], + "description": "Next.js Get Static Path Typescript" } } From 100c6ea9b232a56befec83200a4124276687a768 Mon Sep 17 00:00:00 2001 From: Sabin Baniya <84828938+sabinbaniya@users.noreply.github.com> Date: Fri, 11 Feb 2022 20:55:30 +0545 Subject: [PATCH 3/3] docs: Added snippet docs for Get Static Path Next.js --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 34e46b6..1a63d11 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,17 @@ NextJS and React Snippets with TypeScript support as well!🚀 export default Document; ``` + +5. `ngsp` (Next.js Get Static Path Javascript) + + ```jsx + export const getStaticPaths = async () => { + return { + paths:[${1}], + fallback:false + }; + }; + ### TypeScript @@ -214,3 +225,14 @@ NextJS and React Snippets with TypeScript support as well!🚀 export default Document; ``` + +8. `ngspt` (Next.js Get Static Path Typescript) + + ```tsx + export const getStaticPaths: GetStaticPaths = async () => { + return { + paths:[${1}], + fallback:false + }; + } + ```