import { alignProperty } from '@mui/material/styles/cssUtils'; import React,{Component} from 'react'; import {View, Text, TextInput, Button, StyleSheet} from 'react-native'; export default class EventSearch extends Component { constructor(props) { super(props); this.state={EID:'',Name:'',Sdate:'',Edate:'',Pcount:'',Plimit:'',Description:''}; } SearchEvent=()=> { var EID=this.state.EID; if(EID.length==0) { alert('Field is blank'); } else { var SearchAPIURL="https://ada.uprrp.edu/~pablo.puig1/TPMG/React.php"; var header={ 'Accept':'application/json', 'Content-Type':'application/json' }; var Data={ EID:EID }; fetch( SearchAPIURL, { method:'POST', headers:header, body: JSON.stringify(Data) } ) .then((response)=>response.json()) .then((response)=> { this.setState({EID:response[0].EID}); this.setState({Name:response[0].Name}); this.setState({Sdate:response[0].Sdate}); this.setState({Edate:response[0].Edate}); this.setState({Pcount:response[0].Pcount}); this.setState({Plimit:response[0].Plimit}); this.setState({Description:response[0].Description}); }) .catch((error)=> { alert("Error: " + error); }) } } render() { return( this.setState({EID})} />