Skip to content

Instantly share code, notes, and snippets.

@thecookieorg
Created November 22, 2018 10:39
Show Gist options
  • Save thecookieorg/7e26cf511d0efab68d4bc7f84fd021bb to your computer and use it in GitHub Desktop.
Save thecookieorg/7e26cf511d0efab68d4bc7f84fd021bb to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { View, Text } from 'react-native';
class User extends Component {
render() {
return (
<View>
<Text>Username: {this.props.name}</Text>
<Text>Phone number: {this.props.phone}</Text>
<Image source={this.props.avatar} style={{ width: 200, height: 150 }} />
</View>
);
}
}
export default class AllUsers extends Component {
render() {
return (
<View>
<User
name="Manoylo"
phone="1231234"
avatar="https://api.adorable.io/avatars/285/abottf.png"
/>
<User
name="James Franco"
phone="+156789120" //not his actual phone number :)
avatar="https://api.adorable.io/avatars/285/james.png"
/>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment