Last active
September 5, 2017 07:42
-
-
Save JsseL/ff9a401c5a5e312063bbb78d23a0eefc to your computer and use it in GitHub Desktop.
Sublime snippets
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, {PropTypes} from 'react'; | |
const ${1:${TM_FILENAME/(.+)\..+/$1/}} = (props) => { | |
return ( | |
${4} | |
); | |
}; | |
${1:${TM_FILENAME/(.+)\..+/$1/}}.defaultProps = { | |
${2}, | |
}; | |
${1:${TM_FILENAME/(.+)\..+/$1/}}.propTypes = { | |
${3}, | |
}; | |
export default ${1:${TM_FILENAME/(.+)\..+/$1/}}; | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>pureComponent</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.js</scope> | |
</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 {connect} from 'react-redux'; | |
import ${1:${TM_FILENAME/(.+)\..+/$1/}} from '../components/${1:${TM_FILENAME/(.+)\..+/$1/}}'; | |
const mapStateToProps = (state) => ({ | |
// propName: state.sub.prop, | |
}); | |
const mapDispatchToProps = (dispatch) => ({ | |
// propName: () => dispatch(actionCreator()), | |
}); | |
const Connected${1:${TM_FILENAME/(.+)\..+/$1/}} = connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(${1:${TM_FILENAME/(.+)\..+/$1/}}); | |
export default Connected${1:${TM_FILENAME/(.+)\..+/$1/}}; | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>container</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.js</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment