Skip to content

Instantly share code, notes, and snippets.

@msssk
Last active September 11, 2019 21:45
Show Gist options
  • Save msssk/c639e945933184882b069620957d5cd6 to your computer and use it in GitHub Desktop.
Save msssk/c639e945933184882b069620957d5cd6 to your computer and use it in GitHub Desktop.
{
"React Native Web widget": {
"scope": "typescriptreact",
"prefix": "rn-widget",
"description": "RNW widget with standard imports and props",
"body": [
"import * as React from 'react';",
"import { Component } from 'react';",
"import { View } from 'react-native';",
"import { styles } from './$TM_FILENAME_BASE.styles';",
"",
"export interface ${TM_FILENAME_BASE}Props {}",
"",
"export class $TM_FILENAME_BASE extends Component<${TM_FILENAME_BASE}Props> {",
"\trender() {",
"\t\treturn <View style={styles.root}></View>;",
"\t}",
"}",
""
]
},
"React Native Web widget styles": {
"scope": "typescript",
"prefix": "rn-styles",
"description": "RNW widget styles",
"body": [
"import { StyleSheet } from 'react-native';",
"import { bg } from '~styles';",
"",
"export const styles = StyleSheet.create({",
"\troot: {}",
"});",
""
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment