Professional Documents
Culture Documents
Prefix Method
Redux
Prefix Method
imrcp→ import React, { Component } from 'react' & import PropTypes from 'prop-types'
imrpcp→ import React, { PureComponent } from 'react' & import PropTypes from 'prop-types'
est→ this.state = { }
cdc - componentDidCatch(error,info){$1}
sst→ this.setState({ })
props→ this.props.propName
state→ this.state.stateName
PropTypes
Prefix Method
pta→ PropTypes.array
ptar→ PropTypes.array.isRequired
ptb→ PropTypes.bool
ptbr→ PropTypes.bool.isRequired
ptf→ PropTypes.func
ptfr→ PropTypes.func.isRequired
ptn→ PropTypes.number
ptnr→ PropTypes.number.isRequired
pto→ PropTypes.object
ptor→ PropTypes.object.isRequired
pts→ PropTypes.string
ptsr→ PropTypes.string.isRequired
ptnd→ PropTypes.node
ptndr→ PropTypes.node.isRequired
ptel→ PropTypes.element
ptelr→ PropTypes.element.isRequired
pti→ PropTypes.instanceOf(name)
ptir→ PropTypes.instanceOf(name).isRequired
pte→ PropTypes.oneOf([name])
pter→ PropTypes.oneOf([name]).isRequired
ptet→ PropTypes.oneOfType([name])
ptetr→ PropTypes.oneOfType([name]).isRequired
ptao→ PropTypes.arrayOf(name)
ptaor→ PropTypes.arrayOf(name).isRequired
ptoo→ PropTypes.objectOf(name)
ptoor→ PropTypes.objectOf(name).isRequired
ptsh→ PropTypes.shape({ })
ptany→ PropTypes.any
GraphQL
expgql
Console
Prefix Method
clg→ console.log(object)
ctm→ console.time("timeId")
cte→ console.timeEnd("timeId")
cas→ console.assert(expression,object)
ccl→ console.clear()
cco→ console.count(label)
cdi→ console.dir
cer→ console.error(object)
cgr→ console.group(label)
cge→ console.groupEnd()
ctr→ console.trace(object)
cwa→ console.warn
cin→ console.info
React Components
sl [Stateless Component]
const $1 = () => (
$2
);
const $1 = () => {
return (
$2
);
type P = {
$1
};
type S = {
$2
};
type P = {
$1
};
type S = {
$2
};
constructor(props) {
super(props);
this.state = { $4 };
}
render() {
return (
$5
);
}
ccsr [Component Class With Redux]
state = { $2 }
render() {
return (
$3
);
render() {
return (
<$1Context.Provider value={{ state: { $3 }, actions: {} }}>
{this.props.children}
</$1Context.Provider>
);
}
}
rce
render() {
return <div>$2</div>
export default $1
rcep
static propTypes = {}
render() {
return <div>$2</div>
}export default $1
rpc
render() {
return <div>$2</div>
rpcp
static propTypes = {}
render() {
return <div>$2</div>
rpce
static propTypes = {}
render() {
return <div>$2</div>
rccp
rfcp
function $1(props) {
return <div>$0</div>
$1.propTypes = {}
export default $1
rfc
return <div>$0</div>
rfce
function $1() {
return <div>$0</div>
export default $1
rafcp
return <div>$0</div>
$1.propTypes = {}
export default $1
rafc
const $1 = () => {
return <div>$0</div>
export default $1
rafce
const $1 = () => {
return <div>$0</div>
export default $1
rmc
return <div>$0</div>
})
rmcp
return <div>$0</div>
})
$1.propTypes = {}
export default $1
rcredux
const mapDispatchToProps = {}
mapStateToProps,
mapDispatchToProps,
)(FileName)
rcreduxp
static propTypes = {
$2: $3
render() {
return <div>$4</div>
const mapDispatchToProps = {}
mapStateToProps,
mapDispatchToProps
)(FileName)
reduxmap
const mapDispatchToProps = {}
$2
ffm [FlowFixMe]
// $FlowFixMe
Prefix Method
Prefix Method
just→justifyContent: '',
align→alignItems: '${1}',
as→aspectRatio: '',
bor→borderWidth: ,
flex→flexDirection: '',
h→height: ,
w→width: ,
l→left: '',
mar→marginHorizontal: '',
max→maxWidth: ,
min→minWidth: ,
over→overflow: ,
padding→paddingHorizontal: ,
pos→position: ,
ri→right: ,
z→zIndex: ,
di→direction: ,
back→backgroundColor: ,
sha→shadowColor: ,
op→opacity: ,
e→elevation: ,
)
$1
});
ess [EStyleSheet]
rnf
const $1 = () => {
return (
<View>
<Text> $2 </Text>
</View>
)
}
export default $1
rncs
render() {
return (
<View>
<Text> $2 </Text>
</View>
➢ rnc
rnce
</View>
}
}
export default $1
rnpc
render() {
return (
<View>
<Text> $2 </Text>
</View>
)
}
}
rnpce
render() {
return (
<View>
<Text> $2 </Text>
</View>
)
}
}
export default $1
rncsl
const $1 = ({
params1,
}) => (
<View>
<Text>$2</Text>
</View>
);
rncredux
static propTypes = {
$2: $3
render() {
return (
<View>
<Text> $2 </Text>
</View>
const mapDispatchToProps = {}
mapStateToProps,
mapDispatchToProps
)(FileName)
tsrnc
render() {
return (
<View>
<Text>
$2
</Text>
</View>
);
}
}
tsrnc
render() {
return (
<View>
<Text>$1</Text>
</View>
);
}
}t
srnpc
constructor(props: AppProps) {
super(props);
public render() {
return (
<View>
<Text>
App
</Text>
</View>
);
desc
describe('$1', () => {
$2
})
test
$2
})
tt [Test]
test('$1', () => {
$2
});
describe('$1', () => {
$2
});
tit [Test It]
$4
});
stest
const defaultProps = {}
test('render', () => {
expect(wrapper).toMatchSnapshot()
})
})
srtest
const defaultProps = {}
<Provider store={store}>
</Provider>,
test('render', () => {
expect(wrapper).toMatchSnapshot()
})
})
sntest
import 'react-native'
const defaultProps = {
test('render', () => {
expect(wrapper).toMatchSnapshot()
})
})
snrtest
import 'react-native'
const defaultProps = {}
<Provider store={store}>
</Provider>,
test('render', () => {
expect(wrapper).toMatchSnapshot()
})
})
hocredux
})
return hocComponent
tsrncsl
$2
})
stest
test('render', () => {
expect(setup().wrapper).toMatchSnapshot()
})
})
sjtest
test('render', () => {
expect(toJson(setup().wrapper)).toMatchSnapshot()
})
})
sntest
import 'react-native'
import React from 'react'
import renderer from 'react-test-renderer'
expect(tree).toMatchSnapshot()
})
hocredux
})
hocComponent.propTypes = {
}
return hocComponent
}
hoc
hocComponent.propTypes = {
}
return hocComponent
}
REDUX TUTORIAL
import './index.css';
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
);