-
-
Save eowfenth/6709ffe0296fc1ad534de684e9f3707e to your computer and use it in GitHub Desktop.
React Native Atom snippets
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
| { | |
| ".source.js": | |
| "React: componentDidMount() { ... }": | |
| prefix: "cdm" | |
| body: "componentDidMount() {\n\t${1}\n}" | |
| "React: componentDidUpdate(pp, ps) { ... }": | |
| prefix: "cdup" | |
| body: "componentDidUpdate(prevProps, prevState) {\n\t${1}\n}" | |
| "React: componentWillMount() { ... }": | |
| prefix: "cwm" | |
| body: "componentWillMount() {\n\t${1}\n}" | |
| "React: componentWillReceiveProps(np) { ... }": | |
| prefix: "cwrp" | |
| body: "componentWillReceiveProps(nextProps) {\n\t${1}\n}" | |
| "React: componentWillUnmount() { ... }": | |
| prefix: "cwun" | |
| body: "componentWillUnmount() {\n\t${1}\n}" | |
| "React: componentWillUpdate(np, ns) { ... }": | |
| prefix: "cwup" | |
| body: "componentWillUpdate(nextProps, nextState) {\n\t${1}\n}" | |
| "React: shouldComponentUpdate(np, ns) { ... }": | |
| prefix: "scup" | |
| body: "shouldComponentUpdate(nextProps, nextState) {\n\t${1}\n}" | |
| "React: class skeleton": | |
| prefix: "rcc" | |
| body: "import React from \'react\';\n\nclass $1 extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t$2\n\t\t);\n\t}\n}\n\nexport default ${1};" | |
| "React: stateless component": | |
| prefix: "rcs" | |
| body: "import React from \'react\';\n\nconst $1 = (${2:props}) => {\n\treturn (\n\t\t$3\n\t);\n}\n\nexport default ${1};\n" | |
| "React: local stateless component": | |
| prefix: "rcsl" | |
| body: "const $1 = (${2:props}) => {\n\treturn (\n\t\t$3\n\t);\n}\n" | |
| "React: local component function": | |
| prefix: "rcf" | |
| body: "${1:_methodName} ($2) {\n\t$3\n}" | |
| "React: local component binded function": | |
| prefix: "rcbf" | |
| body: "${1:_methodName} = ($2) => {\n\t$3\n}" | |
| "React: this.props.": | |
| prefix: "props" | |
| body: "this.props.${1}" | |
| "React: this.state.": | |
| prefix: "state" | |
| body: "this.state.${1}" | |
| "React: this.state = { ... }": | |
| prefix: "is" | |
| body: "this.state = {\n\t${1}: ${2}\n}" | |
| "React: setState({ ... })": | |
| prefix: "sst" | |
| body: "this.setState({\n\t${1}: ${2}\n});" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment