Reactjs onBoundsChange属性不可用。谷歌地图

Reactjs onBoundsChange属性不可用。谷歌地图,reactjs,google-maps,Reactjs,Google Maps,使用google map react软件包时,我无法使用proponBoundsChanged,出现错误: No overload matches this call. Overload 1 of 2, '(props: Readonly<Props>): GoogleMapReact', gave the following error. Type '{ children: Element; ref: any; bootstrapURLKeys: { key: stri

使用
google map react
软件包时,我无法使用prop
onBoundsChanged
,出现错误:

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<Props>): GoogleMapReact', gave the following error.
    Type '{ children: Element; ref: any; bootstrapURLKeys: { key: string; }; defaultCenter: any; defaultZoom: any; onDrag: (map: any) => void; onBoundsChanged: (map: any) => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<GoogleMapReact> & Readonly<Props> & Readonly<...>'.
      Property 'onBoundsChanged' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<GoogleMapReact> & Readonly<Props> & Readonly<...>'.
没有与此调用匹配的重载。
重载2中的第1个'(props:Readonly):GoogleMapReact'给出了以下错误。
类型“{children:Element;ref:any;bootstrapURLKeys:{key:string;};defaultCenter:any;defaultZoom:any;onDrag:(map:any)=>void;onBoundsChanged:(map:any)=>void;}”不可分配给类型“IntrinsicAttributes&IntrinsicClassAttributes&Readonly&Readonly”。
类型“IntrinsicatAttributes&IntrinsicClassAttributes&Readonly&Readonly”上不存在属性“onBoundsChanged”。
这是我的示例代码:

class Map extends Component<MapProps, MapState> {

render() {
        return (
        <div className="mapContainer">
            <GoogleMapReact ref={this.map}
            bootstrapURLKeys={{ key: "MY_API_KEY" }}
            defaultCenter={this.props.center}
            defaultZoom={this.props.zoom}
            onDrag = { this.handleMapDrag }
            onBoundsChanged = { ()=>{} }
            >
            <Marker
                lat={this.state.center.lat}
                lng={this.state.center.lng}
            />
            </GoogleMapReact>
        </div>
        );
    }
}
类映射扩展组件{
render(){
返回(
{} }
>
);
}
}
你知道哪里不对吗?我可以毫无问题地使用onDrag道具。我也尝试过使用
onBoundsChange
,但没有任何运气


谢谢。

我已从您的答案中删除了您的API密钥。请不要在公共网站上共享私有API密钥,并确保您按照进行限制。您还可以提供codesandbox或stackblitz,以便我们可以从我们这边复制此问题吗?我已从您的答案中删除了您的API密钥。请不要在公共站点上共享私有API密钥,并确保您根据限制它们。您是否可以提供codesandbox或stackblitz,以便我们能够从我们这边复制此问题?