Closed efstathiosntonas closed 1 year ago
For some reason it imports from commonjs folder instead of typescript one 🤔, tsc
is returning:
xxxx/test.tsx:32:35 - error TS7016: Could not find a declaration file for module 'react-native-safe-area-context'. '/Users/stathis/IdeaProjects/xxxxx/node_modules/react-native-safe-area-context/lib/commonjs/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/react-native-safe-area-context` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-safe-area-context';`
32 import { useSafeAreaInsets } from "react-native-safe-area-context";
I'm facing the same issue.
should be:
"types": "lib/typescript/src/index.d.ts",
it seems bob-builder
messed up somehow?
Fixed in #400
thanks @jacobp100
patch just in case someone can't wait for a release:
react-native-safe-area-context+4.6.0.patch
diff --git a/node_modules/react-native-safe-area-context/package.json b/node_modules/react-native-safe-area-context/package.json
index 68f30e6..db9bdfe 100644
--- a/node_modules/react-native-safe-area-context/package.json
+++ b/node_modules/react-native-safe-area-context/package.json
@@ -5,7 +5,7 @@
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.tsx",
- "types": "lib/typescript/index.d.ts",
+ "types": "lib/typescript/src/index.d.ts",
"source": "src/index.tsx",
"sideEffects": false,
"files": [
Latest release
4.6.0
is missing types.