React ES6 snippets for Atom.
import React, { Component, PropTypes } from 'react';
export default class ${1:MyComponent} extends Component {
static propTypes = {
};
render() {
return (
${2:<div>MyComponent</div>}
);
}
}
import React, { PropTypes } from 'react';
export const ${1:MyComponent} = props => {
return (
${2:<div>MyComponent</div>}
);
}
${3:MyComponent}.propTypes = {
}
componentWillMount() {
${1}
}
componentWillReceiveProps(nextProps) {
${1}
}
componentWillUnmount() {
${1}
}
${1:myProp}: PropTypes.string,
${1:myProp}: PropTypes.string.isRequired,
${1:myProp}: PropTypes.number,
${1:myProp}: PropTypes.number.isRequired,
${1:myProp}: PropTypes.object,
${1:myProp}: PropTypes.object.isRequired,
${1:myProp}: PropTypes.array,
${1:myProp}: PropTypes.array.isRequired,
${1:myProp}: PropTypes.bool,
${1:myProp}: PropTypes.bool.isRequired,
${1:myProp}: PropTypes.element,
${1:myProp}: PropTypes.element.isRequired,
${1:myProp}: PropTypes.func,
${1:myProp}: PropTypes.func.isRequired,