I am currently utilizing an npm package that lacks type definitions for TypeScript. Specifically, I'm working with the react-google-maps
library.
Following their recommended approach, I have imported the following components from the package:
import {GoogleMapLoader, GoogleMap, Marker} from "react-google-maps";
Unfortunately, during compilation, TypeScript presents an error stating that:
error TS2305: Module '"react-google-maps"' has no exported member 'GoogleMapLoader'.
To address this issue quickly, I declared the module and its members as type "any":
declare module "react-google-maps" {
export var GoogleMapLoader:any;
}
However, now I face a new challenge - my IDE (WebStorm) no longer provides intellisense support. The component GoogleMapLoader
is not recognized as a react component, unlike when using Babel which would recognize at least the methods and properties even without typings.
Is there a way to import npm packages without type definitions for TypeScript while still allowing the IDE to offer intellisense?