Snippet Renders
imr Import React
imrc Import React / Component
impt Import PropTypes
impc Import React / PureComponent
cc Class Component
ccc Class Component With Constructor
sfc Stateless Function Component
cdm componentDidMount
cwm componentWillMount
cwrp componentWillReceiveProps
gds getDerivedStateFromProps
scu shouldComponentUpdate
cwu componentWillUpdate
cdu componentDidUpdate
cwu componentWillUpdate
cdc componentDidCatch
gsbu getSnapshotBeforeUpdate
ss setState
ssf Functional setState
ren render
rprop Render Prop
hoc Higher Order Component

hoc

  1. function | (|) {
  2. return class extends Component {
  3. constructor(props) {
  4. super(props);
  5. }
  6. render() {
  7. return < | {...this.props} />;
  8. }
  9. };
  10. }

sfc

  1. const | = props => {
  2. return ( | );
  3. };
  4. export default |;

ccc - Class Component With Constructor

  1. function | (|) {
  2. return class extends Component {
  3. constructor(props) {
  4. super(props);
  5. }
  6. render() {
  7. return < | {...this.props} />;
  8. }
  9. };
  10. }

cc - Class Component

  1. class | extends Component {
  2. state = { | },
  3. render() {
  4. return ( | );
  5. }
  6. }
  7. export default |;