react-google-autocomplete
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -63,2 +63,6 @@ "use strict"; | ||
return new Promise(function (resolve) { | ||
// in case we already have a script on the page and it's loaded we resolve | ||
if (typeof google !== "undefined") return resolve(); | ||
// otherwise we wait until it's loaded and resolve | ||
scriptElement.addEventListener("load", function () { | ||
@@ -169,5 +173,7 @@ return resolve(); | ||
_propTypes2.default.func, | ||
// Or the instance of a DOM native element (see the note about SSR) | ||
// Or the instance of a DOM native element | ||
_propTypes2.default.shape({ current: _propTypes2.default.instanceOf(Element) })]), | ||
autocompleteRef: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.shape({ current: _propTypes2.default.instanceOf(Element) })]), | ||
autocompleteRef: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.shape({ | ||
current: _propTypes2.default.any | ||
})]), | ||
googleMapsScriptBaseUrl: _propTypes2.default.string, | ||
@@ -174,0 +180,0 @@ onPlaceSelected: _propTypes2.default.func, |
{ | ||
"name": "react-google-autocomplete", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React component for google autocomplete.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,3 +1,6 @@ | ||
![](/docs/example.gif) | ||
![](https://img.badgesize.io/ErrorPro/react-google-autocomplete/master/lib/index.js?compression=gzip&label=gzip) | ||
![](https://img.badgesize.io/ErrorPro/react-google-autocomplete/master/lib/index.js?compression=brotli&label=brotli) | ||
![](https://badgen.net/npm/dm/react-google-autocomplete?labelColor=49516F&color=8994BC) | ||
[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://GitHub.com/ErrorPro/react-google-autocomplete/master/LICENSE) | ||
@@ -13,2 +16,6 @@ | ||
or | ||
`yarn add react-google-autocomplete` | ||
<hr> | ||
@@ -130,6 +137,4 @@ | ||
### More examples(dynamic props, MaterialUI) how to use the lib could be found in `examples/index.js` | ||
More examples(dynamic props, MaterialUI) how to use the lib could be found in `docs/examples.js` | ||
[Video of the example](https://api.monosnap.com/file/download?id=vIjRwTxVyMj0Sd2Gjhsfie2SPk1y4l) | ||
### TODO | ||
@@ -136,0 +141,0 @@ |
@@ -45,2 +45,6 @@ import React, { useRef, forwardRef, useEffect, useCallback } from "react"; | ||
return new Promise((resolve) => { | ||
// in case we already have a script on the page and it's loaded we resolve | ||
if (typeof google !== "undefined") return resolve(); | ||
// otherwise we wait until it's loaded and resolve | ||
scriptElement.addEventListener("load", () => resolve()); | ||
@@ -169,3 +173,5 @@ }); | ||
PropTypes.func, | ||
PropTypes.shape({ current: PropTypes.instanceOf(Element) }), | ||
PropTypes.shape({ | ||
current: PropTypes.any, | ||
}), | ||
]), | ||
@@ -172,0 +178,0 @@ googleMapsScriptBaseUrl: PropTypes.string, |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
222493
10
426
147
0