Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "react statefull component": {
- "prefix": "react-native-statefull",
- "body": [
- "import React from 'react';",
- "import {View, StyleSheet} from 'react-native';",
- "",
- "type Props = {",
- "",
- "};",
- "",
- "export default class ${1:Component} extends React.PureComponent<Props> {",
- " public render() {",
- " return (",
- " <View style={styles.container}>",
- " {/**/}",
- " </View>",
- " );",
- " }",
- "",
- "}",
- "",
- "const styles = StyleSheet.create({",
- " container: {",
- "",
- " },",
- "});",
- ""
- ]
- },
- "react statefull connected component": {
- "prefix": "react-native-statefull-connected",
- "body": [
- "import React from 'react';",
- "import {View, StyleSheet} from 'react-native';",
- "import {connect} from 'react-redux';",
- "import {AppState} from 'types/types-redux';",
- "",
- "type Props = {",
- "",
- "};",
- "",
- "class ${1:Component} extends React.PureComponent<Props> {",
- " public render() {",
- " return (",
- " <View style={styles.container}>",
- " {/**/}",
- " </View>",
- " );",
- " }",
- "",
- "}",
- "",
- "const styles = StyleSheet.create({",
- " container: {",
- "",
- " },",
- "});",
- "export default connect((state: AppState) => ({",
- "",
- "}))(${1:Component});",
- ]
- },
- "react stateless component": {
- "prefix": "react-native-stateless",
- "body": [
- "import React from 'react';",
- "import {View, StyleSheet} from 'react-native';",
- "",
- "type Props = {",
- "",
- "};",
- "",
- "export default function ${1:Component}({}: Props) {",
- " return (",
- " <View style={styles.container}>",
- " {/**/}",
- " </View>",
- " );",
- "}",
- "",
- "const styles = StyleSheet.create({",
- " container: {",
- "",
- " },",
- "});",
- "",
- ]
- },
- "react connected stateless comp": {
- "prefix": "react-native-connected-stateless",
- "body": [
- "import React from 'react';",
- "import {View, StyleSheet, Button} from 'react-native';",
- "import {connect} from 'react-redux';",
- "import {AppState} from 'types/types-redux';",
- "",
- "type Props = {",
- "",
- "};",
- "",
- "function ${1:Component}({}: Props) {",
- " return (",
- " <View style={styles.container}>",
- " {/**/}",
- " </View>",
- " );",
- "}",
- "",
- "const styles = StyleSheet.create({",
- " container: {",
- "",
- " },",
- "});",
- "",
- "export default connect((state: AppState) => ({",
- "",
- "}))(${1:Component});",
- ]
- }
- }
Add Comment
Please, Sign In to add comment