@@ -301,7 +301,7 @@ function ResizablePanel(
301301 } ,
302302 } ) ;
303303
304- // Since we sync provided size and the local one in two ways
304+ // Since we sync provided size and the local one in two ways,
305305 // we need a way to prevent infinite loop in some cases.
306306 // We will run this in setTimeout and make sure it will get the most recent state.
307307 const notifyChange = useEvent ( ( ) => {
@@ -329,7 +329,7 @@ function ResizablePanel(
329329 } , [ visualSize , isDragging ] ) ;
330330
331331 useEffect ( ( ) => {
332- setTimeout ( notifyChange ) ;
332+ requestIdleCallback ( notifyChange ) ;
333333 } , [ providedSize ] ) ;
334334
335335 const mods = useMemo ( ( ) => {
@@ -355,9 +355,9 @@ function ResizablePanel(
355355 }
356356 { ...mergeProps ( restProps , {
357357 style : {
358- // We set a current size further via width/min-width/max-width styles to respect size boundaries
358+ // We set the current size further via width/min-width/max-width styles to respect size boundaries
359359 '--size' : `${ size } px` ,
360- // We use a separate visual size to paint the handler for smoother experience
360+ // We use a separate visual size to paint the handler for a smoother experience
361361 '--visual-size' : `${ visualSize } px` ,
362362 '--min-size' : typeof minSize === 'number' ? `${ minSize } px` : minSize ,
363363 '--max-size' : typeof maxSize === 'number' ? `${ maxSize } px` : maxSize ,
0 commit comments