Skip to content

Commit acc2b96

Browse files
committed
fix(ResizablePanel): infinite loop in controllable mode * 8
1 parent 5d8435c commit acc2b96

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/layout/ResizablePanel.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ function ResizablePanel(
255255
},
256256
});
257257

258+
// Since we sync provided size and the local one in two ways
259+
// we need a way to prevent infinite loop in some cases.
260+
// We will run this in setTimeout and make sure it will get the most recent state.
258261
const notifyChange = useEvent(() => {
259262
setSize((size) => {
260263
if (providedSize && Math.abs(providedSize - size) > 0.5) {

0 commit comments

Comments
 (0)