import React, { Component } from 'react';
import { Platform, StyleSheet, View, TextInput, Button } from 'react-native';
export default class App extends Component {
state = {
placeName: ""
}
PlaceNameChangerHandler = val => {
this.setState({
placeName: val
});
};
render() {
return (
<View style={style.container}>
<View style={styles.inputcontainer}>
<TextInput
placeholder="A awsome place"
value={this.state.placeName}
onChangeText={this.PlaceNameChangerHandler}
style={style.placeinput}
/>
<Button title="Addd" style={style.placebutton} />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
marginTop: 50,
justifyContent: "flex-start",
},
inputcontainer: {
flex: 1,
width: "100%",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between"
},
placeinput: {
width: "70%"
},
placebutton: {
width: "30%"
}
});