Open pmw1407 opened 1 year ago
I used addEventListener with resize event, but it doesn't work. Other events like mouseup, mousemove, works really well.
resize
mouseup
mousemove
useEffect(() => { if (newWindowDocument) { newWindowDocument.addEventListener('mouseup', handleMouseUpImage) newWindowDocument.addEventListener('mousemove', handleMouseMoveImage) } return () => { newWindowDocument?.removeEventListener('mouseup', handleMouseUpImage) newWindowDocument?.removeEventListener('mousemove', handleMouseMoveImage) } }, []) useEffect(() => { if (newWindowDocument) { newWindowDocument.addEventListener('resize', handleResize) } }, [scrollRef])
Is it natural that it can't detect it?
I used addEventListener with
resize
event, but it doesn't work. Other events likemouseup
,mousemove
, works really well.Is it natural that it can't detect it?