I am currently working on creating a type definition file for react-native-side-menu in order to properly declare it. I have integrated it into a TypeScript project, but unfortunately, there are no TypeScript definitions available.
Normally, my approach is:
declare module 'react-native-side-menu' {
export class SideMenu {any}
}
This method has been successful with other libraries, but when I try this with react-native-side-menu, I encounter the following error messages:
$ ./node_modules/.bin/tsc --alwaysStrict --skipLibCheck --watch
[12:37:41] File change detected. Starting incremental compilation...
app/views/Movies.tsx:85:8 - error TS2604: JSX element type 'SideMenu' does not have any construct or call signatures.
85 <SideMenu menu={menu}>
~~~~~~~~
app/views/Actors.tsx:80:8 - error TS2604: JSX element type 'SideMenu' does not have any construct or call signatures.
80 <SideMenu menu={menu}>
~~~~~~~~
[12:37:41] Found 2 errors. Watching for file changes.
(I'm importing it like this:
import SideMenu from 'react-native-side-menu'
and it functions correctly within the application. My goal is simply to eliminate the TypeScript error message.)
Is there a proper way to declare this module with TypeScript?