From 6b093c3aefd70f63560f80eb90d1ea1572ff1d26 Mon Sep 17 00:00:00 2001 From: Jayant Bhawal Date: Mon, 1 Jun 2020 17:34:08 +0530 Subject: [PATCH 1/3] Change declaration for the reset function. --- examples/index.tsx | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/examples/index.tsx b/examples/index.tsx index 8862859..f1c7a46 100644 --- a/examples/index.tsx +++ b/examples/index.tsx @@ -99,6 +99,14 @@ const App = () => { setBoxInView({ id }); }; + const reset = () => { + setRotation(0); + setZoom(1); + resetCenter(); + }; + + useEffect(reset, [src]); + const cropperRef = useRef(null); return ( @@ -112,34 +120,7 @@ const App = () => { > Toggle Mode [{cursorMode}] - +