You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
10
10
1.[ReactGoogleAutocomplete](#reactgoogleautocomplete) is a simple html input component that provides functionality of the [google places widgets](https://developers.google.com/maps/documentation/javascript/reference/places-widget#AutocompleteOptions).
11
11
2.[usePlacesWidget](#useplaceswidget) is a react hook that provides the same functionality as `ReactGoogleAutocomplete` does but it does not create any dom elements. Instead, it gives you back a react ref which you can set to any input you want.
12
-
3.[usePlacesAutocompleteService](#useplacesautocompleteservice) is a more complex tool. It uses [google places autocomplete service](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service) and it provides all the functionality to you as the returned value. In addition to that, you can set a `debounce` prop which will reduce the amount of requests users send to Google.
12
+
3.[usePlacesAutocompleteService](#useplacesautocompleteservice) is a more complex react hook. It uses [google places autocomplete service](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service) and it provides all the functionality to you as the returned value. In addition to that, you can set a `debounce` prop which will reduce the amount of requests users send to Google.
13
13
14
14
## Install
15
15
@@ -153,6 +153,7 @@ The hook has only one config argument.
153
153
-`googleMapsScriptBaseUrl`: Provide custom google maps url. By default `https://maps.googleapis.com/maps/api/js`.
154
154
-`debounce`: Number of milliseconds to accumulate responses for.
155
155
-`options`: Default [options](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#QueryAutocompletionRequest) which will be passed to every request.
156
+
-`sessionToken`: If true then a [session token](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompleteSessionToken) will be attached to every request.
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var_extends=Object.assign||function(a){for(varb,c=1;c<arguments.length;c++)for(vardinb=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);returna},_react=require("react"),_react2=_interopRequireDefault(_react),_propTypes=require("prop-types"),_propTypes2=_interopRequireDefault(_propTypes),_usePlacesWidget2=require("./usePlacesWidget"),_usePlacesWidget3=_interopRequireDefault(_usePlacesWidget2);function_interopRequireDefault(a){returna&&a.__esModule?a:{default:a}}function_objectWithoutProperties(a,b){varc={};for(vardina)0<=b.indexOf(d)||Object.prototype.hasOwnProperty.call(a,d)&&(c[d]=a[d]);returnc}functionReactGoogleAutocomplete(a){varb=a.onPlaceSelected,c=a.apiKey,d=a.inputAutocompleteValue,e=a.options,f=a.googleMapsScriptBaseUrl,g=a.refProp,h=_objectWithoutProperties(a,["onPlaceSelected","apiKey","inputAutocompleteValue","options","googleMapsScriptBaseUrl","refProp"]),i=(0,_usePlacesWidget3.default)({ref:g,googleMapsScriptBaseUrl:f,onPlaceSelected:b,apiKey:c,inputAutocompleteValue:d,options:e}),j=i.ref;return_react2.default.createElement("input",_extends({ref:j},h))}ReactGoogleAutocomplete.propTypes={apiKey:_propTypes2.default.string,ref:_propTypes2.default.oneOfType([// Either a function
2
-
_propTypes2.default.func,// Or anything shaped { current: any }
0 commit comments