You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it appears that pushing a new panel on the stack causes the previously active panel to no longer be rendered which, because of the way React works, means it loses any internal state it has. When you navigate back/pop you'll get the old panel component back, but without any state it had built up. In many use cases this is problematic.
This would presumably be a breaking change, unless opt-in via some sort of flag e.g. keepPanelState: true
I suppose we could support a rendering setup similar to how the Tabs component handles renderActiveTabPanelOnly... yes it should be added as an opt-in feature with a flag... something like
/** * If false, PanelStack will render all panels in the stack to the DOM, allowing their React component trees to maintain state as a user navigates through the stack. Panels other than the currently active one will be invisible. * @default true */
renderCurrentPanelOnly?: boolean;
Feature request
Right now it appears that pushing a new panel on the stack causes the previously active panel to no longer be rendered which, because of the way React works, means it loses any internal state it has. When you navigate back/pop you'll get the old panel component back, but without any state it had built up. In many use cases this is problematic.
This would presumably be a breaking change, unless opt-in via some sort of flag e.g.
keepPanelState: true
Demo: https://stackblitz.com/edit/react-fzveef?file=index.js
The text was updated successfully, but these errors were encountered: