属性“ google”不存在于类型“ Readonly <{IGoogleMapTrackerProps}>和Readonly <{chirldren ?: ReactNode; }>'

时间:2020-03-04 08:12:17

标签: javascript node.js reactjs sharepoint

我是SharePoint的新手开发人员,并且坚持使用Google地图。我安装了google-maps-react,但显示一个错误。我不知道该怎么解决... Plz,让我知道这个解决方案...谢谢

1 个答案:

答案 0 :(得分:1)

好吧,它告诉您google不是IGoogleMapTrackerProps中的属性。您指定了将拥有IGoogleMapTrackerProps的道具,但您提供的是Google道具。

如果这是故意的,则可以扩展IGoogleMapTrackerProps使其包含google,例如:

interface Props extends IGoogleMapTrackerProps  {
    google: // type of google
}

并在类定义中使用Props接口而不是IGoogleMapTrackerProps。