Last active
December 18, 2017 22:05
-
-
Save dygufa/d7837a570143ea25a135e99c52fa20c1 to your computer and use it in GitHub Desktop.
React + MobX + Typescript Component Snippet
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
{ | |
"Typescript react component with Mobx": { | |
"prefix": "tsrcm", | |
"body": [ | |
"import * as React from \"react\";", | |
"import { observable } from \"mobx\";", | |
"import { observer, inject } from \"mobx-react\";", | |
"", | |
"interface I${1:ComponentName}Props {}", | |
"", | |
"interface I${1:ComponentName}State {}", | |
"", | |
"@inject()", | |
"@observer", | |
"class ${1:ComponentName} extends React.Component<I${1:ComponentName}Props, I${1:ComponentName}State> {", | |
"\tpublic render() {", | |
"\t\treturn (", | |
"\t\t\t${2:<div>Oi :)</div>}", | |
"\t\t);", | |
"\t}", | |
"}", | |
"", | |
"export default ${1:ComponentName};", | |
"" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment