Migrate to v3
If you are coming from v2 and wish to start using v3, here's a comprehensive list of the deprecated props and how to replace them.
disabled
<GooglePlacesAutocomplete
selectProps={{ isDisabled: true }}
/>
displayFromSuggestionSelected
<GooglePlacesAutocomplete
selectProps={{
getOptionLabel: (option) => string
}}
/>
idPrefix
This prop was used in order to allow multiple instances on the component rendered on the same page. Starting on v3, there's no more need for this prop, but if you need to pass an specific id
, you can do:
<GooglePlacesAutocomplete
selectProps={{
innerProps: {
id: 'your-id' // string
...,
},
}}
/>
initialValue
React-select provides a handful of ways to handle this. Refer to their docs to find the way that best suites your use case.
inputClassName
, inputStyle
, suggestionsClassNames
and suggestionsStyles
React-select provides an easy way to customize the select, refer to their docs.
loader
, renderInput
and renderSuggestions
Again, react-select provides an easy way to use custom components, refer to their docs.
onSelect
<GooglePlacesAutocomplete
selectProps={{ onChange: (object | object[] | null | undefined, action) => undefined }}
/>
placeholder
<GooglePlacesAutocomplete
selectProps={{
placeholder: 'Placeholder...',
}}
/>