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 d544dee

Browse files
skylerwebdevDamian Sznajder
authored and
Damian Sznajder
committed
Added Some Imports and Fixed others.
1 parent bb833e6 commit d544dee

File tree

2 files changed

+85
-37
lines changed

2 files changed

+85
-37
lines changed

‎README.md

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -60,42 +60,48 @@ I.E. `tsrcc`
6060

6161
## React
6262

63-
| Prefix | Method |
64-
| ----------: | ----------------------------------------------------------------------------------- |
65-
| `imr→` | `import React from 'react'` |
66-
| `imrd→` | `import ReactDOM from 'react-dom'` |
67-
| `imrc→` | `import React, { Component } from 'react'` |
68-
| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` |
69-
| `imrpc→` | `import React, { PureComponent } from 'react'` |
70-
| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` |
71-
| `imrm→` | `import React, { memo } from 'react'` |
72-
| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` |
73-
| `impt→` | `import PropTypes from 'prop-types'` |
74-
| `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'` |
77-
| `redux→` | `import { connect } from 'react-redux'` |
78-
| `rconst→` | `constructor(props) with this.state` |
79-
| `rconc→` | `constructor(props, context) with this.state` |
80-
| `est→` | `this.state = { }` |
81-
| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! |
82-
| `cdm→` | `componentDidMount = () => { }` |
83-
| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! |
84-
| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` |
85-
| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! |
86-
| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` |
87-
| `cwun→` | `componentWillUnmount = () => { }` |
88-
| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` |
89-
| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` |
90-
| `ren→` | `render() { return( ) }` |
91-
| `sst→` | `this.setState({ })` |
92-
| `ssf→` | `this.setState((state, props) => return { })` |
93-
| `props→` | `this.props.propName` |
94-
| `state→` | `this.state.stateName` |
95-
| `rcontext→` | `const ${1:contextName} = React.createContext()` |
96-
| `cref→` | `this.${1:refName}Ref = React.createRef()` |
97-
| `fref→` | `const ref = React.createRef()` |
98-
| `bnd→` | `this.methodName = this.methodName.bind(this)` |
63+
| Prefix | Method |
64+
| ----------: | --------------------------------------------------------------------------------------|
65+
| `imr→` | `import React from 'react'` |
66+
| `imrd→` | `import ReactDOM from 'react-dom'` |
67+
| `imrc→` | `import React, { Component } from 'react'` |
68+
| `imrcp→` | `import React, { Component } from 'react' & import PropTypes from 'prop-types'` |
69+
| `imrpc→` | `import React, { PureComponent } from 'react'` |
70+
| `imrpcp→` | `import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'` |
71+
| `imrm→` | `import React, { memo } from 'react'` |
72+
| `imrmp→` | `import React, { memo } from 'react' & import PropTypes from 'prop-types'` |
73+
| `impt→` | `import PropTypes from 'prop-types'` |
74+
| `imrr→` | `import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'` |
75+
| `imbr→` | `import { BrowserRouter as BR} from 'react-router-dom'` |
76+
| `imbrc→` | `import { Route as R, Switch as S, NavLink as NL, Link as L } from react-router-dom'` |
77+
| `imbrr→` | `import { Route as R } from 'react-router-dom'` |
78+
| `imbrs→` | `import { Switch as S } from 'react-router-dom'` |
79+
| `imbrl→` | `import { Link as L } from 'react-router-dom'` |
80+
| `imbrnl→` | `import { NavLink as NL } from 'react-router-dom'` |
81+
| `imrs→` | `import React, { useState } from 'react'` |
82+
| `imrse→` | `import React, { useState, useEffect } from 'react'` |
83+
| `redux→` | `import { connect } from 'react-redux'` |
84+
| `rconst→` | `constructor(props) with this.state` |
85+
| `rconc→` | `constructor(props, context) with this.state` |
86+
| `est→` | `this.state = { }` |
87+
| `cwm→` | `componentWillMount = () => { }` DEPRECATED!!! |
88+
| `cdm→` | `componentDidMount = () => { }` |
89+
| `cwr→` | `componentWillReceiveProps = (nextProps) => { }` DEPRECATED!!! |
90+
| `scu→` | `shouldComponentUpdate = (nextProps, nextState) => { }` |
91+
| `cwup→` | `componentWillUpdate = (nextProps, nextState) => { }` DEPRECATED!!! |
92+
| `cdup→` | `componentDidUpdate = (prevProps, prevState) => { }` |
93+
| `cwun→` | `componentWillUnmount = () => { }` |
94+
| `gdsfp→` | `static getDerivedStateFromProps(nextProps, prevState) { }` |
95+
| `gsbu→` | `getSnapshotBeforeUpdate = (prevProps, prevState) => { }` |
96+
| `ren→` | `render() { return( ) }` |
97+
| `sst→` | `this.setState({ })` |
98+
| `ssf→` | `this.setState((state, props) => return { })` |
99+
| `props→` | `this.props.propName` |
100+
| `state→` | `this.state.stateName` |
101+
| `rcontext→` | `const ${1:contextName} = React.createContext()` |
102+
| `cref→` | `this.${1:refName}Ref = React.createRef()` |
103+
| `fref→` | `const ref = React.createRef()` |
104+
| `bnd→` | `this.methodName = this.methodName.bind(this)` |
99105

100106
## React Hooks
101107

‎snippets/snippets.json

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,49 @@
250250
"import React Router": {
251251
"prefix": "imrr",
252252
"body": [
253-
"import { BrowserRouter as Router, Route, Link } from 'react-router-dom'",
253+
"import { BrowserRouter as BR, Route as R, NavLink as NL } from 'react-router-dom'",
254+
""
255+
]
256+
},
257+
"import React Browser Router": {
258+
"prefix": "imbr",
259+
"body": [
260+
"import { BrowserRouter as Router } from 'react-router-dom'",
261+
""
262+
]
263+
},
264+
"import React Browser Router - Route": {
265+
"prefix": "imbrr",
266+
"body": [
267+
"import { Route as R } from 'react-router-dom'",
268+
""
269+
]
270+
},
271+
"import React Browser Router - Route Combo": {
272+
"prefix": "imbrc",
273+
"body": [
274+
"import { Route as R, Switch as S, NavLink as NL, Link as L } from 'react-router-dom'",
275+
""
276+
]
277+
},
278+
"import React Browser Router - Switch": {
279+
"prefix": "imbrs",
280+
"body": [
281+
"import { Switch as S } from 'react-router-dom'",
282+
""
283+
]
284+
},
285+
"import React Browser Router - Link": {
286+
"prefix": "imbrl",
287+
"body": [
288+
"import { Link as L } from 'react-router-dom'",
289+
""
290+
]
291+
},
292+
"import React Browser Router - NavLink": {
293+
"prefix": "imbrnl",
294+
"body": [
295+
"import { NavLink as NL } from 'react-router-dom'",
254296
""
255297
]
256298
},

0 commit comments

Comments
(0)

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