Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as React from 'react';
- import { Text, View, StyleSheet } from 'react-native';
- import { Constants } from 'expo';
- export default class App extends React.Component {
- productsArray = [
- 'Cajo T-shirt',
- 'Geometric Skull',
- 'Bavaria 350 mL',
- 'Inflatable Alien',
- 'R2D2 RC Car',
- ];
- renderCategories(arrayDeProdutos) {
- return arrayDeProdutos.map((index) => <Text key={index}></Text>);
- }
- render() {
- return (
- <View style={styles.container}>
- {this.renderCategories()}
- </View>
- );
- }
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- justifyContent: 'center',
- paddingTop: Constants.statusBarHeight,
- backgroundColor: '#ecf0f1',
- padding: 8,
- },
- });
- render() {
- return (
- <View style={styles.container}>
- {this.productsArray.map((prod, index) => <Text key={index}>{prod}</Text>)}
- </View>
- );
- }
- <View style={styles.container}>
- {this.renderCategories()}
- </View>
- renderCategories(arrayDeProdutos) {
- return arrayDeProdutos.map((index) => <Text key={index}></Text>);
- }
- render() {
- return (
- <View style={styles.container}>
- {this.renderCategories(this.productsArray)}
- </View>
- );
- }
Add Comment
Please, Sign In to add comment