-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
react-navigation/stack
#135Labels
Description
Hi.
Whenever I import something from this package in my TypeScript project, I get an error saying that the declarations could not be found:
error TS7016: Could not find a declaration file for module 'react-navigation-stack'.
'PROJECT_DIR/node_modules/react-navigation-stack/lib/commonjs/index.js' implicitly has an 'any' type.
Try `npm install @types/react-navigation-stack` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-navigation-stack';`
3 import { StackViewStyleInterpolator } from 'react-navigation-stack';
I believe this is because the field that points at the index.d.ts file should be called types, but is called typescript here. If there is an actual reason that the field is called typescript here, please let me know!
Manually changing the field to types fixes the problem.
Workaround
Prepend all imports from react-navigation-stack with //@ts-ignore