import React, { Component } from 'react'; import {Text, Alert, AppRegistry, Button, StyleSheet, View, TextInput } from 'react-native'; export default class Form1 extends Component { _onPressButton1() { const { navigation } = this.props; const coordinates = navigation.getParam('coordinates'); //var coordinates = this.coordinates ? coordinates : []; Alert.alert("Thank you for your response."); fetch('https://helpthehome-qa.herokuapp.com/mobilerequest', { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ 'coordinates': coordinates, 'type': "Point", 'isInjured': this.state.injured, 'reasonForHelp': this.state.why, 'ageRange': this.state.age, 'clothingDescription': this.state.appearance }), }); } _onPressButton2() { Alert.alert('Continue:') } constructor(props) { super(props); this.state = { age: '', appearance: '', injured: false, why: '' }; } render() { return ( Age: this.setState({age:text})} /> Appearance: this.setState({appearance})} /> Are they injured? this.setState({injured})} /> Reason for help? this.setState({why})} />