我在下面的 TypeScript 代码中收到错误“JSX 元素类型'GoogleMapReact'没有任何构造或调用签名.ts(2604)”。我该如何解决?
import React, { useState } from "react";
import GoogleMapReact from "google-maps-react";
const AnyReactComponent = ({ text }: any) => <div>{text}</div>;
const SimpleMap = (props: any) => {
const [center, setCenter] = useState({ lat: 11.0168, lng: 76.9558 });
const [zoom, setZoom] = useState(11);
return (
<div style={{ height: "100vh", width: "100%" }}>
<GoogleMapReact
bootstrapURLKeys={{ key: "XXXXXXXXXXXXXXXXXXXX" }}
defaultCenter={center}
defaultZoom={zoom}
>
<AnyReactComponent lat={11.0168} lng={76.9558} text="My Marker" />
</GoogleMapReact>
</div>
);
};
export default SimpleMap;