Skip to content

Commit 5208c71

Browse files
author
Damian Sznajder
committed
Add imrs and imrse to imports for functional components. Removed tsrafc.
1 parent 21c24c0 commit 5208c71

File tree

3 files changed

+9
-32
lines changed

3 files changed

+9
-32
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All info about changes
44

55
# Released
66

7+
[2.5.0] - 2019-12-19
8+
9+
- Add `imrs` and `imrse` to imports for functional components. Removed `tsrafc`.
10+
711
[2.4.5] - 2019-12-19
812

913
- Change `cmmb` to be more compliant with jsdocs

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ I.E. `tsrcc`
7272
| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` |
7373
| `impt→` | `import PropTypes from 'prop-types'` |
7474
| `imrr→` | `import { BrowserRouter as Router, Route, Link } from 'react-router-dom'` |
75+
| `imrs→` | `import React, { useState } from 'react'` |
76+
| `imrse→` | `import React, { useState, useEffect } from 'react'` |
7577
| `redux→` | `import { connect } from 'react-redux'` |
7678
| `rconst→` | `constructor(props) with this.state` |
7779
| `rconc→` | `constructor(props, context) with this.state` |
@@ -402,10 +404,7 @@ const mapStateToProps = state => ({})
402404

403405
const mapDispatchToProps = {}
404406

405-
export default connect(
406-
mapStateToProps,
407-
mapDispatchToProps,
408-
)(FileName)
407+
export default connect(mapStateToProps, mapDispatchToProps)(FileName)
409408
```
410409

411410
### `rcreduxp`
@@ -429,10 +428,7 @@ const mapStateToProps = state => ({})
429428

430429
const mapDispatchToProps = {}
431430

432-
export default connect(
433-
mapStateToProps,
434-
mapDispatchToProps
435-
)(FileName)
431+
export default connect(mapStateToProps, mapDispatchToProps)(FileName)
436432
```
437433

438434
### `reduxmap`
@@ -543,10 +539,7 @@ const mapStateToProps = state => ({})
543539

544540
const mapDispatchToProps = {}
545541

546-
export default connect(
547-
mapStateToProps,
548-
mapDispatchToProps
549-
)(FileName)
542+
export default connect(mapStateToProps, mapDispatchToProps)(FileName)
550543
```
551544

552545
## Others

snippets/ts-snippets.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,6 @@
119119
],
120120
"description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface"
121121
},
122-
"typeScriptReactArrowFunctionComponent": {
123-
"prefix": "tsrafc",
124-
"body": [
125-
"import React from 'react'",
126-
"",
127-
"interface Props {",
128-
"\t",
129-
"}",
130-
"",
131-
"export const ${1:${TM_FILENAME_BASE}}: React.FC<Props> = () => {",
132-
"\treturn (",
133-
"\t\t<div>",
134-
"\t\t\t$0",
135-
"\t\t</div>",
136-
"\t)",
137-
"}",
138-
""
139-
],
140-
"description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interfaces"
141-
},
142122
"typeScriptReactClassPureComponent": {
143123
"prefix": "tsrpc",
144124
"body": [

0 commit comments

Comments
 (0)