Release 3.1.1 missing TypeScript Type Declarations
Could not find a declaration file for module 'react-native-ios-context-menu'. '/***/node_modules/react-native-ios-context-menu/lib/commonjs/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/react-native-ios-context-menu` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-ios-context-menu';`ts(7016)
Same for 3.1.2.
If anyone has a solution for this, also happens on 3.0.0
@Acetyld I've downgraded to 3.1.0 and it's good there.
Just confirmed in 3.1.0 also happens (after reset, cache clear, prebuild etc..)
Add this to your tsconfig.json as a temporary fix:
"compilerOptions": {
"paths": {
"react-native-ios-context-menu": [
"node_modules/react-native-ios-context-menu/src/index.tsx"
]
}
}
Add this to your
tsconfig.jsonas a temporary fix:"compilerOptions": { "paths": { "react-native-ios-context-menu": [ "node_modules/react-native-ios-context-menu/src/index.tsx" ] } }
This is the best fix so far =)
The fix doesn't work for on Expo 54 since now typescript will try to typecheck that module and it fails.
The fix doesn't work for on Expo 54 since now typescript will try to typecheck that module and it fails.
With these versions:
"react-native-ios-context-menu": "^3.2.1",
"react-native-ios-utilities": "^5.2.0"
I was able to get typings to work on Expo 54 (even though this is obviously a dirty hack):
"compilerOptions": {
...,
"paths": {
...,
"react-native-ios-context-menu": [
"./node_modules/react-native-ios-context-menu/src/index.tsx"
],
"react-native-ios-utilities": ["./node_modules/react-native-ios-utilities/src/index.ts"]
}
}
It seems like react-native-ios-utilities could not be resolved by react-native-ios-context-menu so adding that did the trick.