1function initialize() {
2
3 var options = {
4 types: ['(cities)'],
5 componentRestrictions: {country: "us"}
6 };
7
8 var input = document.getElementById('searchTextField');
9 var autocomplete = new google.maps.places.Autocomplete(input, options);
10}
11
1<GooglePlacesAutocomplete
2 placeholder='Enter Location'
3 minLength={2}
4 autoFocus={false}
5 returnKeyType={'default'}
6 fetchDetails={true}
7 styles={{
8 textInputContainer: {
9 backgroundColor: 'grey',
10 },
11 textInput: {
12 height: 38,
13 color: '#5d5d5d',
14 fontSize: 16,
15 },
16 predefinedPlacesDescription: {
17 color: '#1faadb',
18 },
19 }}
20/>