From 48de655d4eca4724523af5ccadd9fd2c6cee0244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barbara=20Gawe=C5=82-Kucab?= Date: Tue, 28 May 2024 12:00:50 +0200 Subject: [PATCH] wip --- .github/libs/GitUtils.ts | 4 ++-- src/components/Hoverable/ActiveHoverable.tsx | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/libs/GitUtils.ts b/.github/libs/GitUtils.ts index 684e7c76aa86..dc8ae037be28 100644 --- a/.github/libs/GitUtils.ts +++ b/.github/libs/GitUtils.ts @@ -66,11 +66,11 @@ function getCommitHistoryAsJSON(fromTag: string, toTag: string): Promise { + spawnedProcess.stdout.on('data', (chunk: Buffer) => { console.log(chunk.toString()); stdout += chunk.toString(); }); - spawnedProcess.stderr.on('data', (chunk) => { + spawnedProcess.stderr.on('data', (chunk: Buffer) => { console.error(chunk.toString()); stderr += chunk.toString(); }); diff --git a/src/components/Hoverable/ActiveHoverable.tsx b/src/components/Hoverable/ActiveHoverable.tsx index dd3f41c52578..227e4524eb02 100644 --- a/src/components/Hoverable/ActiveHoverable.tsx +++ b/src/components/Hoverable/ActiveHoverable.tsx @@ -8,6 +8,8 @@ import type HoverableProps from './types'; type ActiveHoverableProps = Omit; +type OnMouseEventProps = (e: MouseEvent) => void; + function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreezeCapture, children}: ActiveHoverableProps, outerRef: Ref) { const [isHovered, setIsHovered] = useState(false); @@ -98,9 +100,10 @@ function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreez const child = useMemo(() => getReturnValue(children, !isScrollingRef.current && isHovered), [children, isHovered]); - const childOnMouseEnter = child.props.onMouseEnter; - const childOnMouseLeave = child.props.onMouseLeave; - const childOnMouseMove = child.props.onMouseMove; + const childOnMouseEnter: OnMouseEventProps = child.props.onMouseEnter; + const childOnMouseLeave: OnMouseEventProps = child.props.onMouseLeave; + const childOnMouseMove: OnMouseEventProps = child.props.onMouseMove; + const childOnBlur: OnMouseEventProps = child.props.onBlur; const hoverAndForwardOnMouseEnter = useCallback( (e: MouseEvent) => { @@ -127,9 +130,9 @@ function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreez setIsHovered(false); } - child.props.onBlur?.(event); + childOnBlur?.(event); }, - [child.props], + [childOnBlur], ); const handleAndForwardOnMouseMove = useCallback(