retyui / react-quick-pinch-zoom

A react component that providing multi-touch gestures for zooming and dragging on any DOM element.
https://react-quick-pinch-zoom.netlify.app/
308 stars 46 forks source link

Does not work with TS. #36

Closed CyanFroste closed 3 years ago

CyanFroste commented 3 years ago
(alias) class QuickPinchZoom
import QuickPinchZoom
JSX element class does not support attributes because it does not have a 'props' property.ts(2607)
'QuickPinchZoom' cannot be used as a JSX component.
  Its instance type 'PinchZoom' is not a valid JSX element.
    Type 'PinchZoom' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.ts(2786)

Also, unable to attach ref to the img tag within.

retyui commented 3 years ago

Fixed in 4.0.2

diff: https://npmfs.com/compare/react-quick-pinch-zoom/4.0.1/4.0.2/

tknaller commented 1 year ago

broken again in 4.5.0 :( but 4.0.2 works as advertised 👍

retyui commented 1 year ago

@tknaller no it's work fine!

I've just create a blank ts project:

npx create-react-app test-pzoom --template typescript
cd test-pzoom/
yarn add react-quick-pinch-zoom
# update App.tsx
yarn tsc --noEmit # no errors