首页 > 解决方案 > 对象不是通用的(google-maps-react)

问题描述

刚刚添加google-maps-react@types/googlemaps我的项目中。现在,当我尝试捆绑项目时,出现以下错误。

../../node_modules/google-maps-react/index.d.ts:29:14 - error TS2315: Type 'Object' is not generic.

29 type Style = Object<string, string | number | boolean>
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

究竟是什么原因造成的?

标签: node.jsreactjstypescriptgoogle-maps-react

解决方案


您需要添加类型google-maps-react

npm install @types/google-maps-react


推荐阅读