Last active
January 26, 2017 19:38
-
-
Save elseloop/0a73f1b4424124400a09381d0ed3b91d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 './${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