Skip to content

Instantly share code, notes, and snippets.

@ciwolsey
Created March 24, 2016 18:38
Show Gist options
  • Save ciwolsey/939bf2a76a98c5511cc1 to your computer and use it in GitHub Desktop.
Save ciwolsey/939bf2a76a98c5511cc1 to your computer and use it in GitHub Desktop.
'.source.js.jsx':
'Stateless React component':
'prefix': 'scomp'
'body': """
const $1 = (props) =>
<div>$2</div>;
$3
"""
'Export with connect()':
'prefix': 'export-connected'
'body': """
function mapStateToProps(state) {
return {$1}
}
function mapDispatchToProps(dispatch) {
return {$2}
}
export default connect(mapStateToProps, mapDispatchToProps)($3);
$4
"""
'React component using React.createClass':
'prefix': 'cccomp'
'body': """
const $1 = React.createClass({
render(){
return <div>$2</div>;
}
});
$3
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment