Skip to content

Instantly share code, notes, and snippets.

@adrian-afergon
Created August 17, 2018 16:07
Show Gist options
  • Save adrian-afergon/79cd960cf8404f501f61b1372e528d78 to your computer and use it in GitHub Desktop.
Save adrian-afergon/79cd960cf8404f501f61b1372e528d78 to your computer and use it in GitHub Desktop.
Create TextInput on view
import React from 'react';
import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
}
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>
<Button title='This is my button' onPress={this.handlerPress}/>
<TextInput />
</View>
);
}
handlerPress = () => {
this.props.myMethod();
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment