12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- import React, { Component } from 'react';
- import { AppRegistry, Image, StyleSheet, Text, View } from 'react-native';
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#fe8',
- alignItems: 'center',
- justifyContent: 'center',
- },
- });
- class App extends Component {
- render() {
- return (
- <View style={styles.container}>
- <Text>Open up App.js to start working on your app!</Text>
- <Text>Changes you make will automatically reload.</Text>
- <Text>Shake your phone to open the developer menu.</Text>
- </View>
- );
- }
- }
- class Bananas extends Component {
- render() {
- const pic = {
- uri: 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg',
- };
- const img = (
- <Image source={pic} style={{
- backgroundColor: 'orange',
- height: 110,
- opacity: 0.9,
- width: '100%',
- }} />
- );
- return (
- img
- );
- }
- }
- class Greeting extends Component {
- render() {
- return (
- <Text>Hello {this.props.name}!</Text>
- );
- }
- }
- export default class LotfOfGreetings extends Component {
- render() {
- return (
- <View style={styles.container}>
- <Greeting name="Rexxar" />
- <Greeting name="Jaina" />
- <Greeting name="Valeera" />
- </View>
- );
- }
- }
- // skip this line if using Create React Native App
- // AppRegistry.registerComponent('AwesomeProject', () => Bananas);
|