File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ Below is a list of all available snippets and the triggers of each one. The **
42
42
| ` cwu→ ` | ` componentWillUpdate method ` |
43
43
| ` cdu→ ` | ` componentDidUpdate method ` |
44
44
| ` cwum→ ` | ` componentWillUnmount method ` |
45
+ | ` gdsfp→ ` | ` getDerivedStateFromProps method ` |
46
+ | ` gsbu ` | ` getSnapshotBeforeUpdate method ` |
45
47
| ` sst→ ` | ` this.setState with object as parameter ` |
46
48
| ` bnd→ ` | ` binds the this of method inside the constructor ` |
47
49
| ` met→ ` | ` simple method ` |
Original file line number Diff line number Diff line change 139
139
" " ,
140
140
" const $1: React.SFC<$1Props> = (props) => {" ,
141
141
" return $0;" ,
142
- " };"
143
- " "
142
+ " };" ,
143
+ " " ,
144
144
" export default $1;"
145
145
],
146
146
"description" : " Create a React Stateless Functional Component."
287
287
" import { $2 } from '$1';"
288
288
],
289
289
"description" : " Create a import"
290
+ },
291
+ "getDerivedStateFromProps" : {
292
+ "prefix" : " gdsfp" ,
293
+ "body" : [
294
+ " static getDerivedStateFromProps(nextProps: ${1:any}, prevState: ${2:any}) {" ,
295
+ " ${0}" ,
296
+ " }"
297
+ ],
298
+ "description" : " Invoked right before calling the render method, both on the initial mount and on subsequent updates"
299
+ },
300
+ "getSnapshotBeforeUpdate" : {
301
+ "prefix" : " gsbu" ,
302
+ "body" : [
303
+ " static getSnapshotBeforeUpdate(prevProps: ${1:any}, prevState: ${2:any}) {" ,
304
+ " ${0}" ,
305
+ " }"
306
+ ],
307
+ "description" : " Invoked right before the most recently rendered output is committed to e.g. the DOM"
290
308
}
291
309
}
You can’t perform that action at this time.
0 commit comments