next-ts-snippets contains snippets for NextJS 13 with TypeScript.
In order to install an extension you need to launch the Command Pallete (Ctrl + Shift + P or Cmd + Shift + P) and type Extensions. There you have either the option to show the already installed snippets or install new ones. Launch VS Code Quick Open (Ctrl + P or Cmd + P), paste the following command, and press enter.
ext install next-ts-snippets
Alternatively you can open the extensions panel and search for 'next-ts-snippets'.
- TypeScript (.ts)
- TypeScript React (.tsx)
Initial release of next-ts-snippets 🎉 🎉 🎉
Snippet | Output |
---|---|
File Conventions | |
tsnxpg |
page file |
tsnxld |
loading file |
tsnxer |
error file |
tsnxnf |
not-found file |
tsnxrl |
root layout file |
tsnxl |
layout file |
tsnxdr |
dynamic route |
---------------- | ---------------- |
Next 13 Component | |
tsnxcl |
client component |
tsnxsv |
server component |
---------------- | ---------------- |
API Routes | |
getapi |
GET route |
postapi |
POST route |
putapi |
PUT route |
deleteapi |
DELETE route |
patchapi |
PATCH route |
optionsapi |
OPTIONS route |
headapi |
HEAD route |
---------------- | ---------------- |
Functions | |
dymd |
generateMetadata |
gsp |
generateStaticParams |
---------------- | ---------------- |
If you have any suggestions or issues, feel free to open an issue or a pull request.
MIT
Enjoy!