GooglePlaceAutocomplete onPress . :
<GooglePlacesAutocomplete
placeholder='Event Location'
minLength={2}
autoFocus={false}
listViewDisplayed='auto'
fetchDetails={true}
renderDescription={row => row.description}
onPress={(data, details = null) => {
this.setState(
{
address: data.description,
coordinates: `${details.geometry.location.lat},${details.geometry.location.lng}`
}
);
}}
textInputProps={{
onChangeText: (text) => { console.warn(text) }
}}
getDefaultValue={() => ''}
query={{
key: 'XXXXXXXXXXXXXXZXZXXXXXXX',
language: 'en',
types: 'geocode'
}}
styles={{
textInputContainer: {
backgroundColor: 'rgba(0,0,0,0)',
borderTopWidth: 0,
borderBottomWidth:0,
},
description: {
fontWeight: 'bold',
},
textInput: {
marginLeft: 22,
marginRight: 0,
height: 38,
color: '#5d5d5d',
fontSize: 16,
},
predefinedPlacesDescription: {
color: '#1faadb'
}
}}
value={props.location}
onChangeText={props.onLocationChange}
renderLeftButton={() => <Text style={{ marginTop: 12, marginLeft:16, fontSize: 18 }}> Location </Text>}
nearbyPlacesAPI='GooglePlacesSearch'
GoogleReverseGeocodingQuery={{
}}
GooglePlacesSearchQuery={{
rankby: 'distance',
types: 'food'
}}
filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']}
debounce={200}
/>