Skip to content

Resize broken in 4.8+ on Vite dev / React Router SSR (panels keep flex-basis from defaultSize) #714

@olegp

Description

@olegp

I'm hitting a regression on resize where panels visibly stop resizing while the
library's internal state still updates. Reproduces on 4.10.0 and 4.11.0.
Pinning to 4.7.6 makes it work again. I haven't bisected 4.8.0/4.9.0
individually.

Setup

  • Vite 7 dev server with React Router 7 SSR (@react-router/dev)
  • React 19.2
  • Three panels (<Panel defaultSize="15%" />, <Panel defaultSize="55%" />,
    <Panel defaultSize="30%" />) with two <Separator>s between them.
  • useDefaultLayout({ id: "tables", storage: localStorage }) on the <Group>.

Expected

After hydration, each Panel renders with flex: <size> 1 0px. Dragging a
separator updates these flex values and panels visibly resize.

Actual

After SSR (introduced in #696), each Panel server-renders with
flex-basis: <defaultSize>. After hydration in our setup the Panel never
re-renders to drop flex-basis and pick up flex-grow: <size>. Dragging a
separator does update the library's state (aria-valuenow changes,
flex-grow: <new size> is written on the panel), but flex-basis: 15% /
55% / 30% stays. Since the basis values sum to 100%, the browser honors
basis and ignores grow, so panels look frozen.

DOM snapshot

Working (production build, 4.7.6):

style="...; display: flex; flex: 15 1 0px; overflow: visible;"

Broken (Vite dev, 4.10.0):

style="...display:flex;flex-basis:15%;overflow:visible"

After dragging in 4.10:

style="...display:flex;flex-basis:15%;overflow:visible;flex-grow:30.828"

(Notice both flex-basis: 15% and flex-grow: 30.828 are set, which gives
no visible resize.)

The same code in a production build (Vite + Rollup) on 4.7.6 doesn't exhibit
the issue: the post-hydration render correctly drops flex-basis and the
panels show flex: <size> 1 0px. So this may be specific to dev-mode SSR /
hydration timing rather than a pure rendering bug.

Version range

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions