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 b637986

Browse files
committed
Add ref & render snippet
1 parent cca57bc commit b637986

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

‎README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ Plug 'SirVer/ultisnips'
3939
| `scup→` | `shouldComponentUpdate(nextProps, nextState) {...}` |
4040
| `cwup→` | `componentWillUpdate(nextProps, nextState) {...}` |
4141
| `cdup→` | `componentDidUpdate(prevProps, prevState) {...}` |
42-
| `cwu→` | `componentWillUnmount() {...}` |
42+
| `cwu→` | `componentWillUnmount() {...}` |
43+
| `ren→` | `render() {...}` |
4344

4445

4546
#### PropTypes
4647

4748
| Trigger | Content |
4849
| -------: | ------- |
49-
| `pt→` | `propTypes {...}` |
50+
| `pt→` | `propTypes {...}` |
5051
| `pt.a→` | `PropTypes.array` |
5152
| `pt.b→` | `PropTypes.bool` |
5253
| `pt.f→` | `PropTypes.func` |
@@ -70,5 +71,6 @@ Plug 'SirVer/ultisnips'
7071
| `props→` | `this.props` |
7172
| `state→` | `this.state` |
7273
| `set→` | `this.setState(...)` |
73-
| `dp→` | `defaultProps {...}` |
74+
| `dp→` | `defaultProps {...}` |
7475
| `cn→` | `className` |
76+
| `ref→` | `ref` |

‎UltiSnips/javascript.snippets‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ snippet state "Get State" i
199199
this.state.${1}
200200
endsnippet
201201

202+
snippet ref "Ref" i
203+
ref={${1:ref} => { this.${2:name} = 1ドル; }}
204+
endsnippet
205+
202206

203207
# Component Lifecycle
204208
snippet cwm "Component Will Mount" b
@@ -243,6 +247,14 @@ componentWillUnmount() {
243247
}
244248
endsnippet
245249

250+
snippet ren "Render"
251+
render() {
252+
return ${1:(
253+
${2:<div>${3}</div>}
254+
);}
255+
}
256+
endsnippet
257+
246258

247259
# PropTypes
248260
snippet pt "PropTypes Definition" b

0 commit comments

Comments
(0)

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