Skip to content

Instantly share code, notes, and snippets.

@adjohu
Created March 29, 2016 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adjohu/e6b63f6393fdfb5045ad to your computer and use it in GitHub Desktop.
Save adjohu/e6b63f6393fdfb5045ad to your computer and use it in GitHub Desktop.
<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>
<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