cometchat / chat-sdk-react-native

Voice & Video Calling and Text Chat SDK for React Native
Other
18 stars 17 forks source link

CometChat.CallingComponent causes Typescript JSX element type error #17

Closed jim-jigx closed 3 years ago

jim-jigx commented 4 years ago

Describe the problem

Using the audio/video chat in a Typescript app causes the following Typescript error:

JSX element type 'CometChat.CallingComponent' does not have any construct or call signatures. ts(2604)

What was the expected behavior?

The component can be used without a Typescript error

Reproduction

It's difficult to show a full repro of the issue but basically see the following:

const callContainer = useCallback(() => { return (

  )

})

In Typescript with the linter enabled, the CometChat.CallingComponent is flagged with the following error:

JSX element type 'CometChat.CallingComponent' does not have any construct or call signatures. ts(2604)

This can be fixed by modifying CometChat.d.ts line 64 to be:L

// let CallingComponent: callingComponent;
let CallingComponent: React.Element

Environment

mayur-bhandari commented 3 years ago

Hello @jim-jigx ,

This issue has been fixed in v2.2.1. Please let us know if you face any other issues.