Skip to content

Commit 4908726

Browse files
committed
fix(ResizablePanel): infinite loop in controllable mode * 4
1 parent 68723a6 commit 4908726

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/components/layout/ResizablePanel.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,11 @@ function ResizablePanel(
270270
useEffect(() => {
271271
if (
272272
(providedSize == null || Math.abs(providedSize - size) > 0.5) &&
273-
visualSize != null &&
274273
!isDragging
275274
) {
276-
setTimeout(() => {
277-
onSizeChange?.(Math.round(visualSize));
278-
});
275+
onSizeChange?.(Math.round(size));
279276
}
280-
}, [visualSize]);
277+
}, [size]);
281278

282279
useEffect(() => {
283280
if (providedSize && Math.abs(providedSize - size) > 0.5) {

0 commit comments

Comments
 (0)