|
1 | 1 | # Next.js and React Snippets README |
2 | 2 |
|
3 | | -This is the README for your extension "Next.js and React Snippets". After writing up a brief description, we recommend including the following sections. |
| 3 | +NextJS and React Snippets with TypeScript support as well!🚀 |
4 | 4 |
|
5 | | -## Features |
| 5 | +# Installation |
6 | 6 |
|
7 | | -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. |
| 7 | +- Install the VSCode extension |
| 8 | +- Reload VSCode |
| 9 | +- Snippets are ready 🎉 |
8 | 10 |
|
9 | | -For example if there is an image subfolder under your extension project workspace: |
| 11 | +# Usage |
10 | 12 |
|
11 | | -\!\[feature X\]\(images/feature-x.png\) |
| 13 | +## React |
12 | 14 |
|
13 | | -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. |
| 15 | +### JavaScript |
14 | 16 |
|
15 | | -## Requirements |
| 17 | +1. `rafce` (React Functional Component) |
16 | 18 |
|
17 | | -If you have any requirements or dependencies, add a section describing those and how to install and configure them. |
| 19 | + ```jsx |
| 20 | + const Component = () => { |
| 21 | + return <div></div>; |
| 22 | + }; |
| 23 | + export default Component; |
| 24 | + ``` |
18 | 25 |
|
19 | | -## Extension Settings |
| 26 | +### TypeScript |
20 | 27 |
|
21 | | -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. |
| 28 | +2. `rafect` (React Functional Component with Types) |
22 | 29 |
|
23 | | -For example: |
| 30 | + ```tsx |
| 31 | + import { FC } from 'react'; |
| 32 | + interface Props {} |
| 33 | + const Component: FC<Props> = () => { |
| 34 | + return <div></div>; |
| 35 | + }; |
| 36 | + export default Component; |
| 37 | + ``` |
24 | 38 |
|
25 | | -This extension contributes the following settings: |
| 39 | +## NextJS |
26 | 40 |
|
27 | | -- `myExtension.enable`: enable/disable this extension |
28 | | -- `myExtension.thing`: set to `blah` to do something |
| 41 | +### JavaScript |
29 | 42 |
|
30 | | -## Known Issues |
| 43 | +1. `nextssr` (Get Server Side Props Next.js) |
31 | 44 |
|
32 | | -Calling out known issues can help limit users opening duplicate issues against your extension. |
| 45 | + ```jsx |
| 46 | + export const getServerSideProps = async (context) => { |
| 47 | + return { |
| 48 | + props: {}, |
| 49 | + }; |
| 50 | + }; |
| 51 | + ``` |
33 | 52 |
|
34 | | -## Release Notes |
| 53 | +2. `nextssg` (Get Static Props Next.js) |
35 | 54 |
|
36 | | -Users appreciate release notes as you update your extension. |
| 55 | + ```jsx |
| 56 | + export const getStaticProps = async (context) => { |
| 57 | + return { |
| 58 | + props: {}, |
| 59 | + }; |
| 60 | + }; |
| 61 | + ``` |
37 | 62 |
|
38 | | -### 1.0.0 |
| 63 | +### TypeScript |
39 | 64 |
|
40 | | -Initial release of ... |
| 65 | +1. `nextssrt` (Get Server Side Props Next.js) |
41 | 66 |
|
42 | | -### 1.0.1 |
| 67 | + ```tsx |
| 68 | + export const getServerSideProps: GetServerSideProps = async (context) => { |
| 69 | + return { props: {} }; |
| 70 | + }; |
| 71 | + ``` |
43 | 72 |
|
44 | | -Fixed issue #. |
| 73 | +2. `nextssgt` (Get Static Props Next.js) |
45 | 74 |
|
46 | | -### 1.1.0 |
| 75 | + ```tsx |
| 76 | + export const getStaticProps: getStaticProps = async (context) => { |
| 77 | + return { props: {} }; |
| 78 | + }; |
| 79 | + ``` |
47 | 80 |
|
48 | | -Added features X, Y, and Z. |
| 81 | +3. `taytay` (NextPage component with NextPage type) |
49 | 82 |
|
50 | | ---- |
51 | | - |
52 | | -## Working with Markdown |
53 | | - |
54 | | -**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: |
55 | | - |
56 | | -- Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux) |
57 | | -- Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux) |
58 | | -- Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets |
59 | | - |
60 | | -### For more information |
61 | | - |
62 | | -- [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) |
63 | | -- [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) |
64 | | - |
65 | | -**Enjoy!** |
| 83 | + ```tsx |
| 84 | + import type { NextPage } from 'next'; |
| 85 | + const Page: NextPage = () => { |
| 86 | + return <></>; |
| 87 | + }; |
| 88 | + export default Page; |
| 89 | + ``` |
0 commit comments