Skip to content

Instantly share code, notes, and snippets.

@XavierGeerinck
Last active November 5, 2015 12:26
Show Gist options
  • Save XavierGeerinck/aa025e6b5d330063d6b4 to your computer and use it in GitHub Desktop.
Save XavierGeerinck/aa025e6b5d330063d6b4 to your computer and use it in GitHub Desktop.
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
# 'Console log':
# 'prefix': 'log'
# 'body': 'console.log $1'
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it here:
# https://github.com/bevry/cson#what-is-cson
'.source.js':
'React Class':
'prefix': 'react'
'body': """
import styles from './${1:CLASSNAME}.scss';
import React, { PropTypes } from 'react';
import cx from 'classnames';
class ${1:CLASSNAME} extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="${1:CLASSNAME}">
</div>
);
}
};
${1:CLASSNAME}.propTypes = {
};
${1:CLASSNAME}.defaultProps = {
};
export default ${1:CLASSNAME};
"""
'.source.js':
'React CX Mixin':
'prefix': 'cx'
'body': """
var cx = React.addons.classSet;
var className = cx({
'"${1:CLASSNAME}': true
});
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment