Resolve conflict

This commit is contained in:
Iñigo
2018-12-27 17:30:42 +01:00
parent 09babd8bb3
commit 94e24d5c74
2 changed files with 7 additions and 11 deletions
+6 -5
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/kenny-hibino/react-places-autocomplete/
// Definitions by: Guilherme Hübner <https://github.com/guilhermehubner>
// Andrew Makarov <https://github.com/r3nya>
// Nokky Goren <https://github.com/ApeNox>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
//
@@ -14,13 +15,10 @@ export interface formattedSuggestionType {
}
export interface PropTypes {
inputProps: {
value: string;
onChange: (value: string) => void;
inputProps?: {
type?: string;
name?: string;
placeholder?: string;
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
disabled?: boolean;
};
onError?: (status: string, clearSuggestion: () => void) => void;
@@ -40,7 +38,7 @@ export interface PropTypes {
autocompleteItem?: React.CSSProperties;
autocompleteItemActive?: React.CSSProperties;
};
options?: {
searchOptions?: {
bounds?: google.maps.LatLngBounds | google.maps.LatLngBoundsLiteral;
componentRestrictions?: google.maps.GeocoderComponentRestrictions;
location?: google.maps.LatLng | google.maps.LatLngLiteral;
@@ -48,6 +46,9 @@ export interface PropTypes {
radius?: number | string;
types?: string[];
};
value?: string;
onChange?: (value: string) => void;
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
debounce?: number;
highlightFirstSuggestion?: boolean;
@@ -40,14 +40,9 @@ class Test extends React.Component {
onChange = (address: string) => this.setState({ address });
render() {
const inputProps = {
value: this.state.address,
onChange: this.onChange,
};
return (
<form onSubmit={this.handleFormSubmit}>
<PlacesAutocomplete inputProps={inputProps} googleCallbackName="google_callback_name" />
<PlacesAutocomplete value={this.state.address} onChange={this.onChange} googleCallbackName="google_callback_name" />
</form>
);
}