DuDigital / react-native-zoomable-view

A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
MIT License
243 stars 113 forks source link

TS7016: Could not find a declaration file for module '@dudigital/react-native-zoomable-view/src/ReactNativeZoomableView'. #28

Closed SaeedZhiany closed 3 years ago

SaeedZhiany commented 4 years ago

I just installed v1.0.15, but when I want to import component I got the error message. also, IDEA seems does not find the component props from the type definition file and so no suggestion provided by IDEA.

image

cc @SimonErich @adamaveray

SimonErich commented 4 years ago

@SaeedZhiany please try to import it generally as follows:

import { ReactNativeZoomableView } from '@dudigital/react-native-zoomable-view';

There are types for accessing directly from the src directly, but for some reason they don't work right now. @adamaveray any idea why that is?

adamaveray commented 4 years ago

@SaeedZhiany @SimonErich Sorry for the delay! I think I must've had a few custom things going on when I set this up since it 'worked on my machine', but I've just set up a bare Typescript project to test and I'm seeing the same issue. Can you try using this repo? https://github.com/adamaveray/react-native-zoomable-view If that works for you I'll submit a new PR!

smjgithub commented 4 years ago

I've tried using the repo you suggested as follows:-

npm install https://github.com/adamaveray/react-native-zoomable-view.git

This adds to my package.json as follows:-

"@dudigital/react-native-zoomable-view": "git+https://github.com/adamaveray/react-native-zoomable-view.git"

I import like this:-

import ReactNativeZoomableView from "@dudigital/react-native-zoomable-view/src/ReactNativeZoomableView";

I still get an error when it compiles as below:-

`Module parse failed: Unexpected token (66:19) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | @type {number} | /

longPressTimeout = null; | | /**`