From 7edefcf36dd0a47e5813c084ca4b30e98e96888b Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Tue, 19 May 2020 14:14:30 +0200 Subject: [PATCH] Specifically use window.setTimeout to not confuse types with Nodes global.setTimeout --- packages/core/src/layout/Sidebar/Bar.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/layout/Sidebar/Bar.tsx b/packages/core/src/layout/Sidebar/Bar.tsx index a03a33ce09..8fd89c313b 100644 --- a/packages/core/src/layout/Sidebar/Bar.tsx +++ b/packages/core/src/layout/Sidebar/Bar.tsx @@ -74,7 +74,7 @@ export const Sidebar: FC = ({ }) => { const classes = useStyles(); const [state, setState] = useState(State.Closed); - const hoverTimerRef = useRef(); + const hoverTimerRef = useRef(); const handleOpen = () => { if (hoverTimerRef.current) { @@ -82,7 +82,7 @@ export const Sidebar: FC = ({ hoverTimerRef.current = undefined; } if (state !== State.Open) { - hoverTimerRef.current = setTimeout(() => { + hoverTimerRef.current = window.setTimeout(() => { hoverTimerRef.current = undefined; setState(State.Open); }, openDelayMs); @@ -99,7 +99,7 @@ export const Sidebar: FC = ({ if (state === State.Peek) { setState(State.Closed); } else if (state === State.Open) { - hoverTimerRef.current = setTimeout(() => { + hoverTimerRef.current = window.setTimeout(() => { hoverTimerRef.current = undefined; setState(State.Closed); }, closeDelayMs);