Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panel and PanelGroup imperative APIs don't work well on mount #217

Closed
bvaughn opened this issue Nov 18, 2023 · 0 comments · Fixed by #219
Closed

Panel and PanelGroup imperative APIs don't work well on mount #217

bvaughn opened this issue Nov 18, 2023 · 0 comments · Fixed by #219

Comments

@bvaughn
Copy link
Owner

bvaughn commented Nov 18, 2023

Related to #211

PanelGroup can't provide a meaningful layout for Panels during the initial render because it doesn't yet know about their constraints. Panels register constraints with the parent PanelGroup on mount, which schedules an update so that PanelGroup can re-render them.

If a parent component uses Panel or PanelGroup imperative APIs on mount (before the scheduled update) the values returned won't be meaningful, and in some cases can even error.

I think the way to work around this is to move layout calculation from an effect to the registerPanel method and to eagerly calculate layouts once all panels have registered.

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 a pull request may close this issue.

1 participant