Skip to content

Commit d9c76e3

Browse files
authored
Merge pull request #24 from sabinbaniya/main
feat: added next js get static path
2 parents 0b26b51 + 100c6ea commit d9c76e3

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ NextJS and React Snippets with TypeScript support as well!🚀
138138
139139
export default Document;
140140
```
141+
142+
5. `ngsp` (Next.js Get Static Path Javascript)
143+
144+
```jsx
145+
export const getStaticPaths = async () => {
146+
return {
147+
paths:[${1}],
148+
fallback:false
149+
};
150+
};
151+
141152
142153
### TypeScript
143154
@@ -214,3 +225,14 @@ NextJS and React Snippets with TypeScript support as well!🚀
214225

215226
export default Document;
216227
```
228+
229+
8. `ngspt` (Next.js Get Static Path Typescript)
230+
231+
```tsx
232+
export const getStaticPaths: GetStaticPaths = async () => {
233+
return {
234+
paths:[${1}],
235+
fallback:false
236+
};
237+
}
238+
```

snippets/next-javascript.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,18 @@
2222
],
2323
"description": "Next.js Get Static Props Typescript"
2424
},
25-
25+
"ngsp": {
26+
"prefix": "ngsp",
27+
"body": [
28+
"export const getStaticPaths = async () => {",
29+
" return {",
30+
" paths:[${1}],",
31+
" fallback:false",
32+
" }",
33+
"}"
34+
],
35+
"description": "Next.js Get Static Path Javascript"
36+
},
2637
"ncapp": {
2738
"prefix": "ncapp",
2839
"body": [

snippets/next-typescript.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,18 @@
7171
],
7272
"description": "Next.js Component Typescript"
7373
},
74-
74+
"ngspt": {
75+
"prefix": "ngspt",
76+
"body": [
77+
"export const getStaticPaths: GetStaticPaths = async () => {",
78+
" return {",
79+
" paths:[${1}],",
80+
" fallback:false",
81+
" }",
82+
"}"
83+
],
84+
"description": "Next.js Get Static Path Typescript"
85+
},
7586
"ncappt": {
7687
"prefix": "ncappt",
7788
"body": [

0 commit comments

Comments
 (0)