I’m working on a React Native project using the react-native-moengage module for analytics. Unfortunately, this library lacks proper TypeScript definitions, and I’m encountering TypeScript errors when running “npm run tsc.”
Here’s what I’ve tried so far on tsconfig.ts exclude and desc.d.ts:
tsconfig.ts exclude code
"exclude": [
"node_modules",
"./node_modules/react-native-moengage/*",
"node_modules/**/*.ts",
"node_modules/react-native-moengage/**/*.ts",
"node_modules/react-native-moengage/src/**/*.ts",
"babel.config.js",
"metro.config.js",
"jest.config.js",
"jest"
]
desc.d.ts
declare module 'react-native-moengage'
Despite these efforts, I’m still getting TypeScript errors from within the react-native-moengage module.
My environtment version:
react-native version: 0.72.13
react-native-moengage: 10.2.0
typescript-version: 4.8.4
How can I force TypeScript to completely ignore the react-native-moengage library and suppress the errors it’s causing? Are there any other workarounds or configurations I should consider?
Screenshot tsc errors:
enter image description here