Change in state does not change default value (getDefaultValue)
See original GitHub issueChange 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 : ''
} />
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
getDefaultValue not rerender with state value change #158
We are trying to update default value in GooglePlacesAutocomplete "getDefaultValue" attribute by changing state value.
Read more >React-Select --- How to get default value and overwrite the ...
My question is how to change the default value('Active') to another selected value('Inactive')?. Thanks const methods = useFormContext(); const ...
Read more >3 Ways to Set Default Value in JavaScript | SamanthaMing.com
Let's break down the 3 different ways to set Default Values using logical operator, ternary, and if/else...
Read more >Setting a default value for an Input element in React | bobbyhadz
Set the `defaultValue` prop on uncontrolled input fields. ... state as a parameter, so the firstName state variable will get initialized to Default...
Read more >Default values of C# types - C# reference - Microsoft Learn
Learn the default values of C# types such as bool, char, int, float, double and more.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll take a look soon, sorry for the late response
Are you still working on this? I have the same issue