From 33cc091e7b91aef1011cf90d278a340037bcc04f Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sun, 12 Jun 2022 20:02:58 -0700 Subject: [PATCH] move onMouseUp to component handler --- components/WidthHandler.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/WidthHandler.js b/components/WidthHandler.js index eb9a7d9..29f9c6f 100644 --- a/components/WidthHandler.js +++ b/components/WidthHandler.js @@ -34,14 +34,6 @@ export default function WidthHandler(props) { return () => window.removeEventListener('mousemove', handleMouseMove) }, [innerRef, onChange]) - React.useEffect(() => { - function handleMouseUp() { - startX.current = null - } - window.addEventListener('mouseup', handleMouseUp) - return () => window.removeEventListener('mouseup', handleMouseUp) - }, []) - return ( // eslint-disable-next-line
{ + startX.current = null + }} role="separator" aria-orientation="vertical" aria-valuemin={minWidth}