Skip to content

Instantly share code, notes, and snippets.

@kynatro
Created January 5, 2018 17:23
Show Gist options
  • Save kynatro/bae65805dd3a8394d3f2e978edca7a10 to your computer and use it in GitHub Desktop.
Save kynatro/bae65805dd3a8394d3f2e978edca7a10 to your computer and use it in GitHub Desktop.
React Component Sublime Snippet
<snippet>
<content><![CDATA[import React, { Component } from 'react'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
const mapStateToProps = (state, ownProps) => {
return {
location: ownProps.location
}
}
class ${1:MyComponent} extends Component {
render() {
return (
<div className="$1">
</div>
)
}
}
export default withRouter(connect(mapStateToProps)($1))
]]></content>
<tabTrigger>rcomp</tabTrigger>
<scope>source.js,source.jsx</scope>
<description>React Component boilerplate</description>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment