react-zoom-pan-pinch 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-zoom-pan-pinch",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Zoom and pan html elements in easy way",
5
5
  "author": "prc5",
6
6
  "license": "MIT",
@@ -32,6 +32,9 @@ export const TransformWrapper = React.forwardRef(
32
32
 
33
33
  useEffect(() => {
34
34
  instance.update(props);
35
+ return () => {
36
+ instance.cleanupWindowEvents();
37
+ };
35
38
  }, [instance, props]);
36
39
 
37
40
  return <Context.Provider value={instance}>{content}</Context.Provider>;
@@ -492,7 +492,7 @@ export const wrapperPropsTable: ComponentProps = {
492
492
  },
493
493
  onTransformed: {
494
494
  type: [
495
- "(ref: ReactZoomPanPinchRef, scale: number, positionX: number, positionY: number ) => void",
495
+ "(ref: ReactZoomPanPinchRef, state: { scale: number; positionX: number; positionY: number } ) => void",
496
496
  ],
497
497
  defaultValue: "undefined",
498
498
  description: "Callback fired when on each transform",