Created
January 5, 2018 17:23
-
-
Save kynatro/bae65805dd3a8394d3f2e978edca7a10 to your computer and use it in GitHub Desktop.
React Component Sublime Snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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