React-native-google-places-autocomplete: Change in state does not change default value (getDefaultValue)

Created on 8 Nov 2017  路  5Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Change in state does not change default value

<GooglePlacesAutocomplete placeholder='Address' minLength={2} autoFocus={false} returnKeyType={'default'} fetchDetails={true} styles={{ textInputContainer: { backgroundColor: 'rgba(0,0,0,0)', borderTopWidth: 0, borderBottomWidth: 1, borderBottomColor: '#D9D5DC' }, textInput: { marginLeft: 0, marginRight: 0, color: '#000000', fontSize: 13, }, predefinedPlacesDescription: { color: '#000000' }, }} query={{ // available options: https://developers.google.com/places/web-service/autocomplete key: 'AIzaSyBAZBpWYMUskFgPU_LATPHd521AKJ3CEz4', language: 'en', // language of the results types: 'geocode' // default: 'geocode' }} placeholderTextColor='#575757' onPress={(data, details = null) => { // 'details' is provided when fetchDetails = true console.log(data, details); this.onAddessSelect(data, details); }} currentLocation={false} nearbyPlacesAPI='GooglePlacesSearch' getDefaultValue={ () => this.state.address_line_1 ? this.state.address_line_1 + ' ' + this.state.address_line_2 + ' ' + this.state.suburb + ' ' + this.state.city : '' } />

Most helpful comment

Are you still working on this? I have the same issue

All 5 comments

Are you still working on this? I have the same issue

any news about that?

I'll take a look soon, sorry for the late response

what is the solution?

any solution to this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

macs03 picture macs03  路  3Comments

tgreco picture tgreco  路  3Comments

RajanPN picture RajanPN  路  3Comments

frankfaustino picture frankfaustino  路  4Comments

lukBakTsh picture lukBakTsh  路  3Comments