Skip to content

Instantly share code, notes, and snippets.

@elseloop
Last active January 26, 2017 19:38
Show Gist options
  • Select an option

  • Save elseloop/0a73f1b4424124400a09381d0ed3b91d to your computer and use it in GitHub Desktop.

Select an option

Save elseloop/0a73f1b4424124400a09381d0ed3b91d to your computer and use it in GitHub Desktop.
<snippet>
<content><![CDATA[
import React, { PropTypes } from 'react';
import styles from './${1}.css';
export const ${1} = (props) => {
const {
tagName:Tag,
className,
variant,
children,
...attrs
} = props;
return (
<Tag className={`${2} ${2}--\${variant} \${className}`} {...attrs}>
{children}
</Tag>
);
}
${1}.propTypes = {
tagName: PropTypes.string,
className: PropTypes.string,
variant: PropTypes.oneOf(['default'])
};
${1}.defaultProps = {
tagName: 'div',
className: '',
variant: 'default'
};
export default ${1};
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>fz</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