Skip to content

Instantly share code, notes, and snippets.

@chranderson
Created December 6, 2016 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chranderson/9990e9e82443f74ed0d3d3e6a7432f91 to your computer and use it in GitHub Desktop.
Save chranderson/9990e9e82443f74ed0d3d3e6a7432f91 to your computer and use it in GitHub Desktop.
'.source.js':
'component':
'prefix': 'comp'
'body': """
import React, { Component, PropTypes } from 'react';
import {
${1:Name}style
} from '${1:Name}Styles.js';
export default class ${1:Name} extends Component {
static propTypes = {
msg: propTypes.string
}
static defaultProps = {
msg: 'this is a msg prop'
}
render() {
// const styles = require('${1:fileName}.scss');
const {
msg
} = this.props;
return (
<div style={ ${1:Name}style }>
msg
</div>
);
}
}
"""
'addState':
'prefix': 'addState'
'body': """
constructor(${1:props}) {
super(${1:props});
this.state = {
${2:property}: ${3:value}
}
// this.${4:function} = this.${4:function}.bind(this);
}
"""
'console.log':
'prefix': 'log'
'body': "console.log('${1:item}: ', ${1:item});"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment