Skip to content

Commit 70d2794

Browse files
committed
fix(ResizablePanel): requestIdleCallback replacement * 2
1 parent c111926 commit 70d2794

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/layout/ResizablePanel.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,13 @@ function ResizablePanel(
337337
}, [visualSize, isDragging]);
338338

339339
useEffect(() => {
340-
if (timerRef.current) {
341-
clearTimeout(timerRef.current);
342-
}
343-
344340
timerRef.current = setTimeout(notifyChange, 500);
341+
342+
return () => {
343+
if (timerRef.current) {
344+
clearTimeout(timerRef.current);
345+
}
346+
};
345347
}, [providedSize]);
346348

347349
const mods = useMemo(() => {

0 commit comments

Comments
 (0)