Skip to content

Commit 2a697a6

Browse files
Arykbell-steven
authored andcommitted
Make getCurrentLocation accessible on the ref object
1 parent f2e92a3 commit 2a697a6

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

GooglePlacesAutocomplete.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ interface GooglePlacesAutocompleteProps {
431431
export type GooglePlacesAutocompleteRef = {
432432
setAddressText(address: string): void;
433433
getAddressText(): string;
434+
getCurrentLocation(): void;
434435
} & TextInput;
435436

436437
export const GooglePlacesAutocomplete: React.ForwardRefExoticComponent<

GooglePlacesAutocomplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const GooglePlacesAutocomplete = forwardRef((props, ref) => {
155155
focus: () => inputRef.current.focus(),
156156
isFocused: () => inputRef.current.isFocused(),
157157
clear: () => inputRef.current.clear(),
158+
getCurrentLocation,
158159
}));
159160

160161
const requestShouldUseWithCredentials = () =>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ _This list is a work in progress. PRs welcome!_
273273
| `blur` | `void` | makes the TextInput lose focus |
274274
| `clear` | `void` | removes all text from the TextInput |
275275
| `isFocused` | `() => boolean` | returns `true` if the TextInput is currently focused; `false` otherwise |
276+
| `getCurrentLocation` | `() => void` | makes a query to find nearby places based on current location |
276277

277278
You can access these methods using a ref.
278279

0 commit comments

Comments
 (0)