Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2e3c82a

Browse files
Add react snippets for javascript and typescript
1 parent 23b9760 commit 2e3c82a

File tree

3 files changed

+781
-0
lines changed

3 files changed

+781
-0
lines changed

‎README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,3 +636,29 @@ process.nextTick(() => {
636636
```javascript
637637
'use strict';
638638
```
639+
### React (JS)
640+
#### `propTypes⇥`
641+
```javascript
642+
static propTypes = {0ドル};
643+
```
644+
645+
#### `defaultProps⇥`
646+
```javascript
647+
static defaultProps = {0ドル};
648+
```
649+
650+
#### `getDerivedStateFromProps⇥`
651+
```javascript
652+
static getDerivedStateFromProps(${1:nextProps}, ${2:prevState}) {0ドル}
653+
```
654+
655+
### React (TS)
656+
#### `defaultProps⇥`
657+
```typescript
658+
static defaultProps: Partial<${1:${TM_FILENAME_BASE}Props}> = {0ドル};
659+
```
660+
661+
#### `getDerivedStateFromProps⇥`
662+
```typescript
663+
static getDerivedStateFromProps(${1:nextProps}: ${3:${TM_FILENAME_BASE}${2:Props}}, ${4:prevState}: ${6:${TM_FILENAME_BASE}${5:State}}): Partial<${6:${TM_FILENAME_BASE}${5:State}}> {0ドル}
664+
```

‎package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
{
3434
"language": "typescriptreact",
3535
"path": "./snippets/snippets.json"
36+
},
37+
{
38+
"path": "./snippets/global.code-snippets"
3639
}
3740
]
3841
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /