React-native-image-viewer: Typescript support

Created on 23 May 2018  路  5Comments  路  Source: ascoders/react-native-image-viewer

Some variables are declared but their values are never read, please remove them

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(5,3): error TS6133: 'Dimensions' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(8,3): error TS6133: 'PanResponder' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(9,3): error TS6133: 'Platform' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(15,3): error TS6133: 'ViewStyle' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(41,11): error TS6133: 'hasLayout' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(171,11): error TS6133: 'sizeLoaded' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(173,9): error TS6133: 'imageLoaded' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(180,11): error TS2339: Property 'getSize' does not exist on type 'typeof Image'.

node_modules/react-native-image-zoom-viewer/src/image-viewer.component.tsx(188,7): error TS6133: 'error' is declared but its value is never read.

node_modules/react-native-image-zoom-viewer/src/image-viewer.type.ts(2,17): error TS6133: 'ImageURISource' is declared but its value is never read.

All 5 comments

You can add this config in tsconfig.json: noUnusedLocals: false

@ascoders Would this mean that noUnusedLocals would apply to all files in my project? Because I certainly don't want this.

@wadim yes it would. it's not a solution. I just changed over to const ImageViewer = require("react-native-image-zoom-viewer") once I was ready to compile. If anyone knows of a way around this it would be great.

@wadim @nicomontanari98 figured it out while I was solving another problem: "skipLibCheck": true in tsconfig.json! 馃憤

@david-cako skipLibCheck is the right way.

Was this page helpful?
0 / 5 - 0 ratings