Reactjs google maps react this.props.google类型中不存在

Reactjs google maps react this.props.google类型中不存在,reactjs,google-maps,google-maps-api-3,spfx,Reactjs,Google Maps,Google Maps Api 3,Spfx,我正试着从中学习这个例子 我犯了这个错误 Property 'google' does not exist on type 'Readonly<{ children?: ReactNode; }> & Readonly<IGoogleMapProps>'. 属性“google”在类型“Readonly&Readonly”上不存在。 进口 import * as React from "react"; import styles from "./GoogleMa

我正试着从中学习这个例子 我犯了这个错误

Property 'google' does not exist on type 'Readonly<{ children?: ReactNode; }> & Readonly<IGoogleMapProps>'.
属性“google”在类型“Readonly&Readonly”上不存在。
进口

import * as React from "react";
import styles from "./GoogleMap.module.scss";
import { IGoogleMapProps } from "./IGoogleMapProps";
import { escape } from "@microsoft/sp-lodash-subset";
import { Map, InfoWindow, Marker, GoogleApiWrapper } from "google-maps-react";
import PropTypes from 'prop-types';

export class GoogleMap extends React.Component<
  IGoogleMapProps,
  {}
  > {




import*as React from“React”;
从“/GoogleMap.module.scss”导入样式;
从“/igooglemprops”导入{igooglemprops}”;
从“@microsoft/sp lodash subset”导入{escape}”;
从“GoogleMaps react”导入{Map,InfoWindow,Marker,GoogleApiWrapper};
从“道具类型”导入道具类型;
导出类GoogleMap扩展了React.Component<
IGooglemps,
{}
> {
渲染方法

 <Map
style={{ width: '100%', height: '100%' }}
google={this.props.google}
centerAroundCurrentLocation={true}
zoom={20}
/>


Webpart.ts


  public render(): void {
    this.properties.list = this.properties.dropdownProperty;
    const element: React.ReactElement<IGoogleMapProps> = React.createElement(
      GoogleMap,
      {
        description: this.properties.description,
        context: this.context,
        spHttpClient: this.context.spHttpClient,
        API_KEY: this.properties.API_KEY,
        lat: this.properties.lat,
        lng: this.properties.lng,
        list: this.properties.list,
        dropdownProperty: this.properties.dropdownProperty,
        google: any //  'any' only refers to a type, but is being used as a value here.
      }
    );

公共呈现():void{
this.properties.list=this.properties.dropdownProperty;
常量元素:React.ReactElement=React.createElement(
谷歌地图,
{
description:this.properties.description,
context:this.context,
spHttpClient:this.context.spHttpClient,
API_键:this.properties.API_键,
lat:this.properties.lat,
lng:this.properties.lng,
列表:this.properties.list,
dropdownProperty:this.properties.dropdownProperty,
google:any/‘any’仅指类型,但在此处用作值。
}
);
我可以知道谷歌的参数是什么吗? 它的定义是什么?
是否有一个解决方法来生成这些数据?

您在props的IgogleApprops界面中定义了什么。错误清楚地显示为“google”没有作为道具存在。请检查该接口。没有,因为我不知道要定义什么,文档也没有定义它。然后不要传递道具接口,然后重试。很遗憾,我无法通过SharePoint网络调用其他API尝试在任何in接口中添加类型为“google”的道具。