nhagen / react-intercom

A component to configure and enable Intercom in your react application
MIT License
237 stars 72 forks source link

Declare IntercomAPI to prevent TypeScript warning #57

Closed ghost closed 5 years ago

ghost commented 6 years ago

Warning -

ts] Module '"/node_modules/react-intercom/index"' has no exported member 'IntercomAPI'.
ghost commented 6 years ago

Also, typo in description, should be: "A component to configure and enable Intercom in your react application"

AnthonyLenglet commented 5 years ago

to anyone getting this issue, the current solution is to keep the version to 1.0.14, the index.d.ts causing the issue wasn't added before then

kubk commented 5 years ago

@nhagen Any chances to get this merged?

jpbow commented 5 years ago

For anyone still running into this warning (I'm using 1.0.15), just create a react-intercom.d.ts file inside of an @types folder in your project root and copy-paste the following declaration. It cleared up the warning for me.

declare module "react-intercom" {
  export function IntercomAPI(method: string, ...args: Array<any>): void;
}