import React, { Component } from 'react'; import { StyleSheet, TextInput, View, Alert, TouchableOpacity, Text } from 'react-native'; export default class App extends Component { constructor(props) { super(props) this.state = { name_l: '', name_u: '', lid: '', uid: '' } } insertList_Function = () => { fetch('https://ada.uprrp.edu/~laura.gonzalez19/4030/insert_list.php', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ name_l: this.state.name_l, name_u: this.state.name_u, lid: this.state.lid, uid: this.state.uid, }) }).then((response) => response.json()) .then((responseJson) => { // Showing response message coming from server after inserting records. Alert.alert(responseJson); }).catch((error) => { console.error(error); }); } render() { return ( Draft: New List Form this.setState({ name_u: data })} underlineColorAndroid='transparent' style={styles.TextInputStyleClass} /> this.setState({ name_l: data })} underlineColorAndroid='transparent' style={styles.TextInputStyleClass} /> this.setState({ uid: data })} underlineColorAndroid='transparent' style={styles.TextInputStyleClass} /> this.setState({ lid: data })} underlineColorAndroid='transparent' style={styles.TextInputStyleClass} /> + Start adding your lists ); } } const styles = StyleSheet.create({ MainContainer: { justifyContent: 'center', alignItems: 'center', flex: 1, margin: 10 }, TextInputStyleClass: { textAlign: 'center', marginBottom: 7, height: 40, width: '80%', borderWidth: 1, borderColor: '#3414B3', borderRadius: 5, }, button: { height:'10%', width: '20%', paddingTop: 2, paddingBottom: 2, backgroundColor: '#3414B3', borderRadius: 100, marginTop: 20 }, text: { color: '#fff', fontSize: 40, textAlign: 'center', padding: 5 } });