Created
August 2, 2018 17:50
-
-
Save radzionc/e898dbb15a883f084acafeed71302761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ changeCityInputValue, cityInputValue, selectCity, city }) => ( | |
<PlacesAutocomplete | |
highlightFirstSuggestion | |
value={cityInputValue} | |
onChange={changeCityInputValue} | |
onSelect={selectCity} | |
searchOptions={{ types: ['(cities)']}} | |
onError={() => changeCityInputValue('')} | |
> | |
{({ getInputProps, suggestions, getSuggestionItemProps, loading, ...rest }) => ( | |
<Paper style={inputContainerStyle}> | |
<TextField | |
{...getInputProps({ | |
placeholder: 'Search City ...', | |
})} | |
/> | |
<List> | |
{suggestions.map((suggestion) => ( | |
<ListItem {...getSuggestionItemProps(suggestion)} key={suggestion.description} button> | |
<ListItemText primary={suggestion.description}/> | |
</ListItem> | |
))} | |
</List> | |
</Paper> | |
)} | |
</PlacesAutocomplete> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment