Clickable button (does not include textarea) - LucyMHall/Fizzy_O GitHub Wiki
``import React, {Component} from 'react'; import {View,
Text, TouchableOpacity, StyleSheet, Button } from 'react-native';
- export default class App extends Component {
-
- constructor(props) {
- super(props); this.state= {text: ""}
}
- render(){
-
- return (
-
<View style= {styles.container}>
- <TouchableOpacity onPress={this.saveData}>
- <Text>Click me to save your user input</Text>
</TouchableOpacity>
</View>
);
- }
-
- saveData(){
- alert ("Success!");
}
};
- const styles= StyleSheet.create({
-
- container: {
- flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center',
},
});