Created
March 29, 2016 12:55
-
-
Save adjohu/e6b63f6393fdfb5045ad to your computer and use it in GitHub Desktop.
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'; | |
//import styles from './${TM_FILENAME/(.+).js/\1/g}.scss'; | |
class ${TM_FILENAME/(.+).js/\u\1/g} extends React.Component { | |
static defaultProps = { | |
$4 | |
}; | |
render() { | |
console.log('$TM_FILENAME', this.props); | |
const {$2...props} = this.props; | |
return ( | |
// <div {...props} className={styles.base}> | |
<div {...props}> | |
$1 | |
</div> | |
) | |
} | |
} | |
export default ${TM_FILENAME/(.+).js/\u\1/g}; | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>rcl</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 React, {PropTypes} from 'react'; | |
import {connect} from 'react-redux'; | |
@connect( | |
state => { | |
$1 | |
} | |
) | |
class ${TM_FILENAME/(.+).js/\u\1/g} extends React.Component { | |
static propTypes = { | |
$4 | |
} | |
render() { | |
console.log(this.props); | |
const {$3} = this.props; | |
return ( | |
<div> | |
$2 | |
</div> | |
) | |
} | |
} | |
export default ${TM_FILENAME/(.+).js/\u\1/g}; | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>rco</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