Skip to content
Design System
GitHub

0.42 migration

0.42 moves resizable to react-resizable-panels 4. The props products pass most keep working; callbacks, refs and the library's data attributes follow version 4.

What keeps working

Component0.410.42Notes
ResizablePanelGroupdirectiondirection or orientationThe same values.
ResizablePaneldefaultSize={40}, minSize, maxSize, collapsedSizethe same numbersStill percentages of the group (version 4 alone reads a number as pixels). A string takes a unit: "240px", "20rem".
ResizablePanelGroupautoSaveIdautoSaveIdRestored after hydration without a mismatch. Give each panel an id: sizes saved by 0.41 are then read, otherwise they start from defaultSize once.
ResizableHandlewithHandlewithHandleThe same grip, line, hit area, colours and focus ring.

What changed

Before 1.0 a rename or a removal is a minor version. A removed prop is a type error where it is used; a changed callback argument often is, but a CSS selector or a resize(30) is not, so search for those.

Where0.410.42How
ResizablePanelGrouponLayout={(sizes) => …}onLayoutChanged={(layout) => …}layout maps panel id to percentage. onLayoutChange fires on every pointer move; prefer onLayoutChanged, which fires on release.
ResizablePanelGroupref (getLayout(), setLayout([…]))groupRefgetLayout() and setLayout({ list: 30, map: 70 }) use the same id map. useGroupRef() types it.
ResizablePanelGroupkeyboardResizeBy, storage, tagNameremovedArrow keys move 5%. For another storage, call useDefaultLayout from react-resizable-panels and pass defaultLayout and onLayoutChanged.
ResizablePanelonCollapse, onExpandonResizeCompare panelSize.asPercentage with the collapsed size, or ask panelRef.current.isCollapsed().
ResizablePanelonResize={(size, prev) => …}onResize={(size, id, prev) => …}size is { asPercentage, inPixels }, not a number.
ResizablePanelref (resize(30), getSize())panelRef (resize("30%"), getSize().asPercentage)resize(30) is 30 px in version 4: write the unit. usePanelRef() types it.
ResizablePanelorderremovedPanels follow their order in the DOM; give conditional panels an id.
ResizableHandleonDragging, hitAreaMargins, tagNameremoveddata-separator="active" while dragging; the hit area is the group's resizeTargetMinimumSize (the kit's: 16 px, --h-md on a touch screen).
Your CSS[data-panel-group-direction=vertical]the group's [data-orientation=vertical], the handle's [aria-orientation=horizontal]A vertical group is split by a horizontal separator.
Your CSS[data-resize-handle-state=drag], =hover[data-separator=active], =hoverAlso focus, inactive and disabled.
Your CSS and testsdata-panel-size, data-panel-id, data-panel-group-idthe handle's aria-valuenow, the panel's and group's idA Panel's className is now on an element inside the panel.
KeyboardArrow 10%, Shift+Arrow all the wayArrow 5%; Home and End all the wayF6 and Shift+F6 move between handles; a double-click restores the default size.
Find what to move
# Run from your project's root: what is left to move by hand. The compiler lists the removed props too.
grep -rnE 'onLayout=|keyboardResizeBy|onCollapse=|onExpand=|onDragging=|hitAreaMargins|ImperativePanel(Group)?Handle|data-panel-group-direction|data-resize-handle|data-panel-size' src