mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #31725 from InigoDDC/react-places-autocomplete-add-googleCallbackName
[@types/react-places-autocomplete] add googleCallbackName property to PropTypes
This commit is contained in:
+4
-6
@@ -8,8 +8,7 @@
|
||||
// TypeScript Version: 2.8
|
||||
//
|
||||
/// <reference types="googlemaps" />
|
||||
|
||||
import * as React from "react";
|
||||
import * as React from 'react';
|
||||
|
||||
export type AutocompletePrediction = google.maps.places.AutocompletePrediction;
|
||||
|
||||
@@ -29,6 +28,8 @@ export interface Suggestion {
|
||||
}
|
||||
|
||||
export interface PropTypes {
|
||||
onChange?: (value: string) => void;
|
||||
value?: string;
|
||||
onError?: (status: string, clearSuggestion: () => void) => void;
|
||||
onSelect?: (address: string, placeID: string) => void;
|
||||
searchOptions?: {
|
||||
@@ -39,13 +40,10 @@ export interface PropTypes {
|
||||
radius?: number | string;
|
||||
types?: string[];
|
||||
};
|
||||
value?: string;
|
||||
onChange?: (value: string) => void;
|
||||
|
||||
debounce?: number;
|
||||
highlightFirstSuggestion?: boolean;
|
||||
shouldFetchSuggestions?: boolean;
|
||||
|
||||
googleCallbackName?: string;
|
||||
children: (opts: Readonly<{
|
||||
loading: boolean;
|
||||
suggestions: ReadonlyArray<Suggestion>;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import PlacesAutocomplete, { geocodeByAddress, geocodeByPlaceId, getLatLng } from 'react-places-autocomplete';
|
||||
import PlacesAutocomplete, {
|
||||
geocodeByAddress, geocodeByPlaceId, getLatLng
|
||||
} from 'react-places-autocomplete';
|
||||
|
||||
class Test extends React.Component {
|
||||
state = {
|
||||
@@ -28,7 +30,7 @@ class Test extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<form onSubmit={this.handleFormSubmit}>
|
||||
<PlacesAutocomplete value={this.state.address} onChange={this.onChange}>
|
||||
<PlacesAutocomplete value={this.state.address} onChange={this.onChange} googleCallbackName="google_callback_name">
|
||||
{({getInputProps, getSuggestionItemProps, suggestions}) => (
|
||||
<>
|
||||
<input {...getInputProps()} />
|
||||
|
||||
Reference in New Issue
Block a user