react-native-ios-context-menu icon indicating copy to clipboard operation
react-native-ios-context-menu copied to clipboard

Release 3.1.1 missing TypeScript Type Declarations

Open 0xDing opened this issue 1 year ago • 8 comments

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)

0xDing avatar Apr 01 '25 19:04 0xDing

Same for 3.1.2.

alizahid avatar Apr 29 '25 08:04 alizahid

If anyone has a solution for this, also happens on 3.0.0

Acetyld avatar Jun 02 '25 15:06 Acetyld

@Acetyld I've downgraded to 3.1.0 and it's good there.

alizahid avatar Jun 03 '25 06:06 alizahid

Just confirmed in 3.1.0 also happens (after reset, cache clear, prebuild etc..)

Acetyld avatar Jun 04 '25 11:06 Acetyld

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"
      ]
    }
  }

lauridskern avatar Jul 23 '25 14:07 lauridskern

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" ] } }

This is the best fix so far =)

stichingsd-vitrion avatar Jul 30 '25 12:07 stichingsd-vitrion

The fix doesn't work for on Expo 54 since now typescript will try to typecheck that module and it fails.

terrysahaidak avatar Nov 06 '25 18:11 terrysahaidak

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.

e-younan avatar Nov 15 '25 19:11 e-younan