Last active
October 3, 2016 09:42
-
-
Save SPY/9037afe1b32ce2a99eaa6e1991e2b7e2 to your computer and use it in GitHub Desktop.
Code snippet for fast react class scafolding
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
{ | |
"New React Class for CSP": { | |
"prefix": "new-react-csp", | |
"body": [ | |
"import * as React from 'react'", | |
"import * as bem from 'csp-react/src/bem'", | |
"", | |
"export interface ${Component}Props extends React.Props<${Component}> {", | |
"\tclassName?: string | { toString(): string }", | |
"}", | |
"", | |
"interface ${Component}State extends React.Props<${Component}> { }", | |
"", | |
"const b = bem.block('${css-class}')", | |
"", | |
"export default class ${Component} extends React.Component<${Component}Props, ${Component}State> {", | |
"\trender() {", | |
"\t\treturn (", | |
"\t\t\t<div className={b.mix(this.props.className)}>", | |
"\t\t\t</div>", | |
"\t\t)", | |
"\t}", | |
"}" | |
], | |
"description": "New React Class for csp project" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment