-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
Document about potential issues with remounting #172
Comments
@yangshun I'm running into the same problem, I tried to set the |
Nothing special, I just added id fields to all the Panel components. If you provide a repro I can help to take a look. |
I had the issue also specifying the ids. I actually solved using the API on the single Panel components |
This seems like a good suggestion. In general, I don't want to make I'll add a note to the #FAQ section. May also be nice to add a DEV-only warning if we detect the following scenario:
|
FAQ updated in ddf346e. I'm going to give the DEV warning a bit more thought, but hopefully this at least helps others. |
Dev warning added in #174 and published in 0.0.54 ❤️ → ☕ givebrian.coffee |
Thank you for this library! P.S. bought you some coffees ☕ |
That was very kind of you! ❤️ |
Background
Hi Brian 👋🏻 , thanks for this awesome library! I'm building a window tiling manager (similar to VS Code) on top of this library and it renders a dynamic grid of panels which can be nested indefinitely. Here's the demo if you're interested (there are still some bugs but the general idea is there).
Issue
I ran into some issue regarding
<Panel>
s not showing the correct width after remounting. Here's a simplified repro of the issue: https://stackblitz.com/edit/stackblitz-starters-eac7cb?file=src%2FApp.tsx:After some digging, I think the problem is with the right panel remounting and having a new internal ID, hence there's no existing size available in the
PanelGroupContext
and it renders with 0 width. I kinda solved the issue by passing the right<Panel>
a stableid
. Please lemme know if there's a better way.Suggestion
I'm not sure if this is considered a bug, but I think it'd be useful to document somewhere that when doing dynamic/conditional rendering of
<Panel>
s, there's a potential issue with remounting and that stableid
s can be passed in to prevent the issue.The text was updated successfully, but these errors were encountered: