React snippets (live templates) for idea.
- Download
settings.jar
- Click on "File" -> "Importing Settings..." select
settings.jar
and click OK.
import $START$ from '$END$';
import { $START$ } from '$END$';
import React, { Component } from 'react';
$END$
import '$END$';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
export default class $COMPONENT$ extends Component {
render() {
return (
<div>$END$</div>
);
}
}
$COMPONENT$.defaultProps = {};
$COMPONENT$.propTypes = {};
import React from 'react';
import PropTypes from 'prop-types';
const $COMPONENT$ = ($PARAMETER$) => {
return (
<div>$END$</div>
);
}
$COMPONENT$.defaultProps = {};
$COMPONENT$.propTypes = {};
export default $COMPONENT$;
import React from 'react';
import PropTypes from 'prop-types';
function $COMPONENT$($PARAMETER$) {
return (
<div>$END$</div>
);
}
$COMPONENT$.propTypes = {};
$COMPONENT$.defaultProps = {};
export default $COMPONENT$;
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
export default class $COMPONENT$ extends PureComponent {
render() {
return (
<div>$END$</div>
);
}
}
$COMPONENT$.defaultProps = {};
$COMPONENT$.propTypes = {};
constructor(props) {
super(props);
$END$
}
constructor(props) {
super(props);
this.state = { $START$ };
$END$
}
state = {
$START$: $END$,
};
static defaultProps = {
$START$: $END$,
};
static propTypes = {
$START$: PropTypes.$END$,
};
componentDidCatch() {
$END$
}
componentDidMount() {
$END$
}
componentDidUpdate(prevProps, prevState) {
$END$
}
componentWillMount() {
$END$
}
componentWillReceiveProps(nextProps$START$) {
$END$
}
componentWillUpdate(nextProps, nextState) {
$END$
}
componentWillUnmount() {
$END$
}
shouldComponentUpdate(nextProps, nextState) {
$END$
}
getSnapshotBeforeUpdate(prevProps, prevState) {
$END$
}
render() {
return (
<div>$END$</div>
);
}
$COMPONENT$.propTypes = {
$START$: PropTypes.$END$,
};
$START$: PropTypes.$END$,
this.props.$END$
this.state.$END$
const { $END$ } = this.props;
const { $END$ } = this.state;
this.setState({ $START$: $END$ });
const mapDispatchToProps = dispatch => {
return {
$END$
};
};
const mapStateToProps = state => {
return {
$END$
};
};
export default connect($PARAM$, $PARAM2$)($COMPONENT$);
ref={$PROPERTY$ => this.$END$ = $PROPERTY$}
const $NAME$ = () => {
$END$
};
$NAME$ = () => {
$END$
}
const $NAME$ = ($PARAMS$) => {
$END$
};
$NAME$ = ($PARAM$) => {
$END$
}