[google-maps-react] Fix InfoWindow Types (#41799)

* [google-maps-react] Fix InfoWindow Types

* Bump TypeScript
This commit is contained in:
Paito Anderson
2020-01-30 16:07:30 -05:00
committed by GitHub
parent 8123af1bee
commit 47403b246b
2 changed files with 14 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { GoogleAPI, Map, Marker, MapProps, GoogleApiWrapper } from 'google-maps-react';
import { GoogleAPI, Map, Marker, MapProps, GoogleApiWrapper, InfoWindow } from 'google-maps-react';
import * as React from 'react';
interface Location {
@@ -56,7 +56,11 @@ class MapContainer extends React.Component<Props> {
position={ hit._geoloc }
title={ hit.title }
key={ hit.id }
/>;
>
<InfoWindow>
<p>Test</p>
</InfoWindow>
</Marker>;
});
}
}

View File

@@ -2,8 +2,9 @@
// Project: https://github.com/fullstackreact/google-maps-react#readme
// Definitions by: Gordon Burgett <https://github.com/gburgett>
// Justin Powell <https://github.com/jpowell>
// Paito Anderson <https://github.com/PaitoAnderson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.0
import 'googlemaps';
import * as React from 'react';
@@ -103,12 +104,15 @@ export class HeatMap extends React.Component<any, any> {
}
export interface InfoWindowProps extends Partial<google.maps.InfoWindowOptions> {
google: typeof google;
map: google.maps.Map;
marker: google.maps.Marker;
google?: typeof google;
map?: google.maps.Map;
marker?: google.maps.Marker;
mapCenter?: google.maps.LatLng | google.maps.LatLngLiteral;
visible?: boolean;
onOpen?: () => void;
onClose?: () => void;
}
export class InfoWindow<P extends InfoWindowProps = InfoWindowProps, S = any> extends React.Component<P, S> {