From 8fca5d67f809edacca1d9d4f0e84b00d69af004f Mon Sep 17 00:00:00 2001 From: Steven Bell Date: Sun, 1 Aug 2021 22:05:41 -0400 Subject: [PATCH] run prettier --- GooglePlacesAutocomplete.js | 13 +++++++++---- README.md | 19 +++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/GooglePlacesAutocomplete.js b/GooglePlacesAutocomplete.js index e881c3b..73d5a8a 100644 --- a/GooglePlacesAutocomplete.js +++ b/GooglePlacesAutocomplete.js @@ -143,8 +143,8 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => { }, []); useEffect(() => { // Update dataSource if props.predefinedPlaces changed - setDataSource(buildRowsFromResults([])) - }, [props.predefinedPlaces]) + setDataSource(buildRowsFromResults([])); + }, [props.predefinedPlaces]); useImperativeHandle(ref, () => ({ setAddressText: (address) => { @@ -530,7 +530,9 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => { }; // eslint-disable-next-line react-hooks/exhaustive-deps - const debounceData = useMemo(() => debounce(_request, props.debounce), [props.query]); + const debounceData = useMemo(() => debounce(_request, props.debounce), [ + props.query, + ]); const _onChangeText = (text) => { setStateText(text); @@ -849,7 +851,10 @@ GooglePlacesAutocomplete.propTypes = { listEmptyComponent: PropTypes.func, listUnderlayColor: PropTypes.string, // Must write it this way: https://stackoverflow.com/a/54290946/7180620 - listViewDisplayed: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['auto'])]), + listViewDisplayed: PropTypes.oneOfType([ + PropTypes.bool, + PropTypes.oneOf(['auto']), + ]), keepResultsAfterBlur: PropTypes.bool, minLength: PropTypes.number, nearbyPlacesAPI: PropTypes.string, diff --git a/README.md b/README.md index 6e97acd..3cd3397 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - npm version @@ -266,15 +265,15 @@ _This list is a work in progress. PRs welcome!_ ## Methods -| method name | type | description | -| ---------------- | ------------------------- | ----------------------------------------------------------------------- | -| `getAddressText` | `() => string` | return the value of TextInput | -| `setAddressText` | `(value: string) => void` | set the value of TextInput | -| `focus` | `void` | makes the TextInput focus | -| `blur` | `void` | makes the TextInput lose focus | -| `clear` | `void` | removes all text from the TextInput | -| `isFocused` | `() => boolean` | returns `true` if the TextInput is currently focused; `false` otherwise | -| `getCurrentLocation` | `() => void` | makes a query to find nearby places based on current location | +| method name | type | description | +| -------------------- | ------------------------- | ----------------------------------------------------------------------- | +| `getAddressText` | `() => string` | return the value of TextInput | +| `setAddressText` | `(value: string) => void` | set the value of TextInput | +| `focus` | `void` | makes the TextInput focus | +| `blur` | `void` | makes the TextInput lose focus | +| `clear` | `void` | removes all text from the TextInput | +| `isFocused` | `() => boolean` | returns `true` if the TextInput is currently focused; `false` otherwise | +| `getCurrentLocation` | `() => void` | makes a query to find nearby places based on current location | You can access these methods using a ref.