RN(3) Props

Props

Bananas

import React, { Component } from 'react';
import { AppRegistry, Image } from 'react-native';
class MyFirstReactNativeProject extends Component {
render() {
let pic = {
uri : 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
};
return (
<Image source={pic} style={{width: 193, height: 110}}/>
);
}
}
AppRegistry.registerComponent('MyFirstReactNativeProject', () => MyFirstReactNativeProject);

21:31:45.jpg

LotsOfGreetings

import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
class MyFirstReactNativeProject extends Component {
render() {
return (
<View style={{alignItems:'center'}}>
<Greeting name='Joker'/>
<Greeting name='Peter'/>
<Greeting name='Mike'/>
</View>
);
}
}
class Greeting extends Component {
render() {
return (
<Text>
Hello {this.props.name}!
</Text>
);
}
}
AppRegistry.registerComponent('MyFirstReactNativeProject', () => MyFirstReactNativeProject);

22:02:07.jpg