For the version without semi-colon look this one https://marketplace.visualstudio.com/items?itemName=EQuimper.react-native-react-redux-snippets-for-es6-es7-version-standard
After install this snippets add this inside your settings
"editor.snippetSuggestions": "top",
Snippets | Content |
---|---|
imr | Import React |
imro | Import React as Object |
imrc | Import React Component |
imrpc | Import React PureComponent |
imrn | Import React-Native Element |
ims | Import Styled-Components |
imsn | Import Styled-Components Native |
impt | Import PropTypes |
rct | Redux constant |
crr | Connect Redux |
sl | Stateless Component |
slr | Stateless Component Return |
slc | Stateless Component Function |
ccs | Component Class |
cccs | Component Class With Constructor |
ccsf | Component Class FlowType |
pcs | PureComponent Class |
pccs | PureComponent Class With Constructor |
pcsf | PureComponent FlowType |
ccsr | Component Class With Redux |
edccs | Export default Component Class |
rrd | Redux Reducer |
rpf | Redux Pure Function |
rpc | Redux Pure Function Const |
cwm | ComponentWillMount |
cdm | ComponentDidMount |
cdu | ComponentDidUpdate |
scu | ShouldComponentUpdate |
cwu | ComponentWillUpdate |
cwum | ComponentWillUnmount |
cwrp | ComponentWillReceiveProps |
cdc | ComponentDidCatch |
cct | Create Context |
gds | getDerivedStateFromProps |
rnss | StyleSheet Style |
ess | EStyleSheet Style |
ed | Export default |
edl | EslintDisableLine |
ednl | EslintDisableNextLine |
styc | Styled Component |
estyc | Export Styled Component |
edstyc | Export default Styled Component |
cmmb | Comment Big Block |
log | Console Log |
cl | Standard console.log |
tt | Test |
tdesc | Test Describe |
tit | Test It |
ffm | FlowFixMe |
rnstory | React-Native Story |
rstory | React Story |
rsf | React Stateless Function |
import React from 'react';
import * as React from 'react';
import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import { $1 } from 'react-native';
import styled from 'styled-components';
import styled from 'styled-components/native';
import PropTypes from 'prop-types';
export const $1 = '$1';
import { connect } from 'react-redux';
const $1 = () => (
$2
);
export default $1;
const $1 = () => {
return (
$2
);
}
export default $1;
function $1($2) {
$3
}
export default $1;
class $1 extends Component {
state = { $2 }
render() {
return (
$3
);
}
}
export default $1;
class $1 extends Component {
constructor(props) {
super(props);
this.state = { $2 };
}
render() {
return (
$3
);
}
}
export default $1;
type P = {
$1
};
type S = {
$2
};
class $3 extends Component<P, S> {
constructor(props) {
super(props);
this.state = { $4 };
}
render() {
return (
$5
);
}
}
export default $3;
class $1 extends PureComponent {
state = { $2 }
render() {
return (
$3
);
}
}
export default $1;
class $1 extends PureComponent {
constructor(props) {
super(props);
this.state = { $2 };
}
render() {
return (
$3
);
}
}
export default $1;
type P = {
$1
};
type S = {
$2
};
class $3 extends PureComponent<P, S> {
constructor(props) {
super(props);
this.state = { $4 };
}
render() {
return (
$5
);
}
}
export default $3;
class $1 extends Component {
state = { $2 }
render() {
return (
$3
);
}
}
export default connect($4, $5)($1);
export default class $1 extends Component {
state = { $2 }
render() {
return (
$3
);
}
}
export default (state = $1, action) => {
switch (action.type) {
case $2:
$3
default:
return state;
}
};
export const $1 = '$1';
export function $2($3) {
return {
type: $1,
$3
}
}
export const $1 = '$1';
export const $2 = $3 => ({
type: $1,
$3
});
componentWillMount() {
$1
}
componentWillUpdate() {
$1
}
componentDidUpdate(prevProps, prevState) {
$1
}
shouldComponentUpdate(nextProps, nextState, nextContext) {
$1
}
componentDidMount() {
$1
}
componentWillUnmount() {
$1
}
componentWillReceiveProps(nextProps) {
$1
}
componentDidCatch(error, info) {
$1
}
const $1Context = createContext($2);
class $1Provider extends Component {
state = {
$3
}
render() {
return (
<$1Context.Provider value={{ state: { $3 }, actions: {} }}>
{this.props.children}
</$1Context.Provider>
);
}
}
export default $1Provider;
static getDerivedStateFromProps(nextProps, prevState) {
$1
}
const styles = StyleSheet.create({
$1
});
import EStyleSheet from 'react-native-extended-stylesheet';
const styles = EStyleSheet.create({
$1
});
export default styles;
export default $1;
// eslint-disable-line
// eslint-disable-next-line
const $1 = styled.$2`
$3
`
export const $1 = styled.$2`
$3
`
export default styled.$1`
$2
`
/**
|--------------------------------------------------
| $1
|--------------------------------------------------
*/
console.log('====================================');
console.log($1);
console.log('====================================');
console.log($1);
test('$1', () => {
$2
});
describe('$1', () => {
$2
});
it('should $1', $2($3) => {
$4
});
// $FlowFixMe
import React from 'react';
import { storiesOf } from '@storybook/react-native';
storiesOf('$1', module)
.add('default', () => $2);
import React from 'react';
import { storiesOf } from '@storybook/react';
storiesOf('$1', module)
.add('default', () => $2);
React.useEffect(() => {
$1
}, []);
import React from "react";
function $1(props) {
return (
<div>
</div>
);
}
export default $1;