Skip to content

Commit 0f4338f

Browse files
authored
Merge pull request #7 from Kira272921/readme
docs: improve the readme
2 parents 872351e + d6788da commit 0f4338f

File tree

2 files changed

+77
-53
lines changed

2 files changed

+77
-53
lines changed

README.md

Lines changed: 64 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,89 @@
11
# Next.js and React Snippets README
22

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!🚀
44

5-
## Features
5+
# Installation
66

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 🎉
810

9-
For example if there is an image subfolder under your extension project workspace:
11+
# Usage
1012

11-
\!\[feature X\]\(images/feature-x.png\)
13+
## React
1214

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
1416

15-
## Requirements
17+
1. `rafce` (React Functional Component)
1618

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+
```
1825

19-
## Extension Settings
26+
### TypeScript
2027

21-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
28+
2. `rafect` (React Functional Component with Types)
2229

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+
```
2438

25-
This extension contributes the following settings:
39+
## NextJS
2640

27-
- `myExtension.enable`: enable/disable this extension
28-
- `myExtension.thing`: set to `blah` to do something
41+
### JavaScript
2942

30-
## Known Issues
43+
1. `nextssr` (Get Server Side Props Next.js)
3144

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+
```
3352

34-
## Release Notes
53+
2. `nextssg` (Get Static Props Next.js)
3554

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+
```
3762

38-
### 1.0.0
63+
### TypeScript
3964

40-
Initial release of ...
65+
1. `nextssrt` (Get Server Side Props Next.js)
4166

42-
### 1.0.1
67+
```tsx
68+
export const getServerSideProps: GetServerSideProps = async (context) => {
69+
return { props: {} };
70+
};
71+
```
4372

44-
Fixed issue #.
73+
2. `nextssgt` (Get Static Props Next.js)
4574

46-
### 1.1.0
75+
```tsx
76+
export const getStaticProps: getStaticProps = async (context) => {
77+
return { props: {} };
78+
};
79+
```
4780

48-
Added features X, Y, and Z.
81+
3. `taytay` (NextPage component with NextPage type)
4982

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+
```
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"rafce": {
3-
"prefix": "rafce",
4-
"body": [
5-
"const ${1:${TM_FILENAME}}= () => {",
6-
" return <div></div>;",
7-
"};",
8-
"",
9-
"export default ${1:${TM_FILENAME}};",
10-
""
11-
],
12-
"description": "React Functional Component "
13-
}
14-
}
2+
"rafce": {
3+
"prefix": "rafce",
4+
"body": [
5+
"const ${1:${TM_FILENAME}}= () => {",
6+
" return <div></div>;",
7+
"};",
8+
"",
9+
"export default ${1:${TM_FILENAME}};",
10+
""
11+
],
12+
"description": "React Functional Component"
13+
}
14+
}

0 commit comments

Comments
 (0)