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

Layout normalisation warning on a PanelGroup with 0 children #396

Closed
MrSimmmons opened this issue Aug 29, 2024 · 3 comments · Fixed by #397
Closed

Layout normalisation warning on a PanelGroup with 0 children #396

MrSimmmons opened this issue Aug 29, 2024 · 3 comments · Fixed by #397

Comments

@MrSimmmons
Copy link

Building upon the example provided in #126 (using the exact same code, but with the most recent version of react-resizable-panels) you get a rather large console warning if you intentionally set the layout of a container to an empty array.

output.mp4

I wonder if this warning is necessary as the library seems to handle the scenario rather well bar some drag positioning shenanigans (which is likely a dnd-kit issue and not react-resizable-panels issue). Its also worth noting that this warning is not formatted correctly for scenarios where you are setting the size to 0. So I wonder if its safe to say that the normalisation can be performed on a PanelGroup if its final state is empty.

@bvaughn
Copy link
Owner

bvaughn commented Aug 29, 2024

I’m not opposed to a different warning in that case! Seems like an empty panel group is probably still something worth warning about (in Dev mode) but I agree that message is goofy

@bvaughn
Copy link
Owner

bvaughn commented Aug 29, 2024

The warning has been removed entirely for empty panel groups as of v2.1.2


❤️ → ☕ givebrian.coffee

@MrSimmmons
Copy link
Author

MrSimmmons commented Aug 30, 2024

Legend!
Enjoy the coffee ;)

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.

2 participants