Skip to content

Commit 127b149

Browse files
committed
docs: add full examples
1 parent d90f87a commit 127b149

31 files changed

+176
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to the "vscode-js-ts-react-nextjs-snippets" extension will be documented in this file.
44

5+
## 1.13.0 <small>- 2022/09/14</small>
6+
7+
- Added React.lazy snippet (`_rLazy`)
8+
- Added [React Router](https://reactrouter.com/) snippets
9+
- Improved documentation! [Full Examples](./snippets.md) are now available 🥳
10+
511
## 1.12.0 <small>- 2022/09/07</small>
612

713
- Improved JSON stringify/parse wrapper-snippet

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ For TypeScript snippets:
2323
- Check React snippets using `$r`
2424
- Check [Next.js](https://nextjs.org/) snippets using `$n`
2525
- Check [React Native](https://reactnative.dev/) snippets using `$rn`
26+
- Check [React Router](https://reactrouter.com/) snippets using `$rou`
2627
- Check [React Query](https://react-query.tanstack.com/) snippets using `$rq`
2728
- Check [SWR](https://swr.vercel.app/) snippets using `$swr`
2829
- Check [Redux](https://react-redux.js.org/) snippets using `$rx`
@@ -32,6 +33,8 @@ For TypeScript snippets:
3233
- Check [Emotion CSS](https://emotion.sh/docs/introduction) snippets using `$emo`
3334
- Check wrapper-snippets using `$_`
3435

36+
### 👉 [See All Available Snippets Here!](./snippets.md) 👈
37+
3538
## Examples
3639

3740
![Next.js snippet](./images/snippet-next-js.gif)
@@ -56,7 +59,7 @@ Select text and copy it 📋 write snippet and boom! 🪄💥
5659

5760
## Why There Are No Snippet for Import? 🤔
5861

59-
Because you might not need that. VSCode has built-in feature for auto-import your modules.
62+
Because you might not need that. VSCode has built-in feature for auto-import your modules. Use `Ctrl`+`Space` on your variable and a popup will appear.
6063

6164
<img src="./images/auto-import.gif" alt="VSCode built-in auto import" width="100%" />
6265

images/demo/01.1-console.gif

620 KB
Loading
210 KB
Loading

images/demo/01.3-arrow-function.gif

477 KB
Loading

images/demo/01.4-json.gif

661 KB
Loading

images/demo/01.5-typeof.gif

157 KB
Loading
1.14 MB
Loading
Loading

images/demo/02.3-react-hooks.gif

1.56 MB
Loading

images/demo/02.4-jsx-wrapper.gif

1.15 MB
Loading

images/demo/02.5-react-lazy.gif

252 KB
Loading

images/demo/02.6-dangerous-html.gif

171 KB
Loading
373 KB
Loading

images/demo/03.3-next-use-router.gif

135 KB
Loading
599 KB
Loading
637 KB
Loading

images/demo/05.1-react-router.gif

507 KB
Loading
761 KB
Loading

images/demo/06.1-react-query.gif

1.28 MB
Loading

images/demo/07.1-swr.gif

147 KB
Loading

images/demo/08.1-redux-store.gif

493 KB
Loading

images/demo/08.2-redux-slice.gif

458 KB
Loading

images/demo/08.3-redux-hooks.gif

53.3 KB
Loading

images/demo/09.1-test-block.gif

440 KB
Loading
231 KB
Loading

images/demo/10.1-react-hook-form.gif

706 KB
Loading
277 KB
Loading

images/demo/11.1-zustand-hooks.gif

379 KB
Loading

images/demo/12.1-emotion-css.gif

600 KB
Loading

snippets.md

+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
First of all, you need to understand that we don't provide a snippet for importing your package like any other VSCode snippets extention.
2+
3+
`imr``import React from 'react'`
4+
5+
👆 We don't do it here.
6+
7+
We encourage you to use the built-in auto import from VSCode.
8+
Use `Ctrl`+`Space` on your variable and a popup will appear.
9+
10+
<img src="./images/auto-import.gif" alt="VSCode built-in auto import" width="100%" />
11+
12+
If auto import doesn't appear, open command palette (`Ctrl`+`Shift`+`P`) and select restart TS server.
13+
14+
![Restart TS server](./images/vscode-restart-ts-server.png)
15+
16+
---
17+
18+
Okay, here we go...
19+
20+
# All Available Snippets
21+
22+
## Vanilla JavaScript
23+
24+
### Console
25+
26+
![Console](./images/demo/01.1-console.gif)
27+
28+
### setTimeout & setInterval
29+
30+
![setTimeout & setInterval](./images/demo/01.2-set-timeout-set-interval.gif)
31+
32+
### Arrow Function
33+
34+
![Arrow Function](./images/demo/01.3-arrow-function.gif)
35+
36+
### JSON.stringify & JSON.parse
37+
38+
![JSON.stringify & JSON.parse](./images/demo/01.4-json.gif)
39+
40+
### typeof
41+
42+
![typeof](./images/demo/01.5-typeof.gif)
43+
44+
## React
45+
46+
### Component (Regular Function)
47+
48+
![TODO](./images/demo/02.1-react-function-component.gif)
49+
50+
### Component (Arrow Function)
51+
52+
![TODO](./images/demo/02.2-react-arrow-function-component.gif)
53+
54+
### React Hooks
55+
56+
![TODO](./images/demo/02.3-react-hooks.gif)
57+
58+
### JSX Wrapper
59+
60+
![TODO](./images/demo/02.4-jsx-wrapper.gif)
61+
62+
### React Lazy
63+
64+
![TODO](./images/demo/02.5-react-lazy.gif)
65+
66+
### React dangerouslySetInnerHTML
67+
68+
![TODO](./images/demo/02.6-dangerous-html.gif)
69+
70+
## Next.js
71+
72+
### Next.js getServerSideProps, getStaticProps, getStaticPaths
73+
74+
![Next.js snippet](./images/snippet-next-js.gif)
75+
76+
### Next.js Custom Document
77+
78+
![TODO](./images/demo/03.2-next-custom-document.gif)
79+
80+
### Next.js Router
81+
82+
![TODO](./images/demo/03.3-next-use-router.gif)
83+
84+
### Next.js Dynamic Import
85+
86+
![TODO](./images/demo/03.4-next-dynamic-import.gif)
87+
88+
## React Native
89+
90+
### React Native Component
91+
92+
![TODO](./images/demo/04.1-react-native-component.gif)
93+
94+
## React Router
95+
96+
### Create Router
97+
98+
![TODO](./images/demo/05.1-react-router.gif)
99+
100+
### React Router Hooks
101+
102+
![TODO](./images/demo/05.2-react-router-hooks.gif)
103+
104+
## React Query
105+
106+
### React Query
107+
108+
![TODO](./images/demo/06.1-react-query.gif)
109+
110+
## SWR
111+
112+
### SWR Hook
113+
114+
![TODO](./images/demo/07.1-swr.gif)
115+
116+
## Redux
117+
118+
### Redux Store
119+
120+
![TODO](./images/demo/08.1-redux-store.gif)
121+
122+
### Redux Slice
123+
124+
![TODO](./images/demo/08.2-redux-slice.gif)
125+
126+
### Redux Hooks
127+
128+
![TODO](./images/demo/08.3-redux-hooks.gif)
129+
130+
## Testing
131+
132+
### Test Block
133+
134+
![TODO](./images/demo/09.1-test-block.gif)
135+
136+
### Before & After
137+
138+
![TODO](./images/demo/09.2-test-before-after.gif)
139+
140+
## React Hook Form
141+
142+
### React Hook Form
143+
144+
![TODO](./images/demo/10.1-react-hook-form.gif)
145+
146+
## Zustand
147+
148+
### Zustand Config
149+
150+
![TODO](./images/demo/11.1-zustand-create-store.gif)
151+
152+
### Zustand Hooks
153+
154+
![TODO](./images/demo/11.1-zustand-hooks.gif)
155+
156+
## Emotion CSS
157+
158+
### Emotion CSS in React Component
159+
160+
![TODO](./images/demo/12.1-emotion-css.gif)
161+
162+
## TypeScript
163+
164+
### Generate Types/Interface from Clipboard
165+
166+
![Generate-from-clipboard snippet](./images/snippet-from-clipboard.gif)

0 commit comments

Comments
 (0)