Skip to content

Commit e34b0b0

Browse files
author
sw-yx
committed
update snippets
1 parent 81c591a commit e34b0b0

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ It contains no class component APIs, assumes you use synthetic default imports,
88

99
It does a bit more based on the principle that it is easier to delete than to type, and so that we have just 3 easy to remember snippets: `rfc`, `rhc`, `rsc`.
1010

11+
Because [the popular styled components snippets extension](https://github.com/lXSPandora/vscode-styled-components-snippets) only works for javascript 🙄, we also include an import snippet `imrsc`.
12+
1113
## Installation
1214

1315
In order to install an extension you need to launch the Command Pallete (Ctrl + Shift + P or Cmd + Shift + P) and type Extensions.
@@ -28,14 +30,23 @@ Alternatively you can open the extensions panel and search for 'swyx-react-types
2830

2931
Below is a list of all available snippets and the triggers of each one. The **** means the `TAB` key.
3032

31-
| Trigger | Content |
32-
| ------: | ---------------------------------------------- |
33-
| `rfc→` | `create a react function component (no hooks)` |
34-
| `rhc→` | `create a react hooks component` |
35-
| `rsc→` | `create a react styeld component (no hooks)` |
33+
| Trigger | Content |
34+
| -------: | ---------------------------------------------- |
35+
| `rfc→` | `create a react function component (no hooks)` |
36+
| `rhc→` | `create a react hooks component` |
37+
| `rsc→` | `create a react styled component (no hooks)` |
38+
| `imrsc→` | `import react and styled component` |
3639

3740
```json
3841
{
42+
"import react and styled components": {
43+
"prefix": "imrsc",
44+
"body": [
45+
"import React from 'react'",
46+
"import styled from 'styled-components'"
47+
],
48+
"description": "import react and styled components"
49+
},
3950
"React Function Component": {
4051
"prefix": "rfc",
4152
"body": [

snippets/snippets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
{
2+
"import react and styled components": {
3+
"prefix": "imrsc",
4+
"body": [
5+
"import React from 'react'",
6+
"import styled from 'styled-components'"
7+
],
8+
"description": "import react and styled components"
9+
},
210
"React Function Component": {
311
"prefix": "rfc",
412
"body": [

0 commit comments

Comments
 (0)