Skip to content

Instantly share code, notes, and snippets.

@inifaisal
Last active September 14, 2017 04:37
Show Gist options
  • Save inifaisal/3ae3e5bfda9835f95f465b5638347f92 to your computer and use it in GitHub Desktop.
Save inifaisal/3ae3e5bfda9835f95f465b5638347f92 to your computer and use it in GitHub Desktop.
{
"Add Author Comment": {
"prefix": "author",
"body": [
"/**",
" * Author: Your mae",
" * Email: [email protected]",
" */"
],
"description": "add author comment"
},
// console.log() is important than other snippet
"Print to console": {
"prefix": "log",
"body": ["console.log('$1');", "$2"],
"description": "Log output to console"
},
"Create React Native Component": {
"prefix": "crnc",
"body": [
"import React, { Component } from 'react'",
"import {",
" View,",
" Text,",
" StyleSheet,",
"} from 'react-native';",
"",
"class $1 extends Component {",
" render() {",
" return (",
" <View style={styles.container}>",
" <Text>$1</Text>",
" </View>",
"",
" )",
" }",
"}",
"",
"const styles = StyleSheet.create({",
" container: {",
" }",
"});",
"",
"export default $1",
""
],
"description": "Create React Native Component"
},
"Create React Native Stateless Component": {
"prefix": "crnsc",
"body": [
"import React from 'react'",
"import {",
" View,",
" Text,",
" StyleSheet,",
"} from 'react-native';",
"",
"const $1 = () => {",
" return (",
" <View style={styles.container}><Text>$1</Text></View>",
" )",
"}",
"const styles = StyleSheet.create({",
" container: {",
" }",
"});",
"",
"export default $1",
""
],
"description": "Create React Native Stateless Component"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment