Working with a non-React external library in a custom block
The problem is here: useEffect( () => { if ( ref.current ) { var panzoom = Panzoom(ref.current, { minScale: 1.1, maxScale: 5, startScale: 1.1, animate: true, duration: 1000, origin: ‘50% 0’ }); } }, []); useEffect runs again when the dependencies parameter changes, but by providing none it will only run once. If you want …