Skip to content

fix: avoid flicker when controlled pane sizes also change content#889

Open
akx wants to merge 1 commit into
tomkp:masterfrom
akx:layout-fix
Open

fix: avoid flicker when controlled pane sizes also change content#889
akx wants to merge 1 commit into
tomkp:masterfrom
akx:layout-fix

Conversation

@akx

@akx akx commented Jun 9, 2026

Copy link
Copy Markdown

In my app, you can collapse panes to thin "sliver" windowshades; when you do that, the content also changes (to the pane's title, rendered vertically).

Since react-split-pane is using useEffect to sync a controlled width into its state, this means the pane's content changes before the width does, leading to a flicker of about one frame where the pane's content is the vertical title, but the width is still wide.

This fixes that by using useLayoutEffect, when available, for that sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant