Skip to content

Commit

Permalink
Refactored Panel/PanelGroup to better work with strict effects mode (#…
Browse files Browse the repository at this point in the history
…219)

Resolves #217
  • Loading branch information
bvaughn authored Nov 20, 2023
1 parent f42a524 commit 018a5bd
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function UrlPanelGroupToData(
urlPanelGroup: ReactElement<PanelGroupProps>
): UrlPanelGroup {
return {
autoSaveId: urlPanelGroup.props.autoSaveId,
autoSaveId: urlPanelGroup.props.autoSaveId ?? undefined,
children: Children.toArray(urlPanelGroup.props.children).map((child) => {
if (isPanelElement(child)) {
return UrlPanelToData(child);
Expand Down
2 changes: 2 additions & 0 deletions packages/react-resizable-panels/src/Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function PanelWithForwardedRef({
expandPanel,
getPanelSize,
getPanelStyle,
groupId,
isPanelCollapsed,
registerPanel,
resizePanel,
Expand Down Expand Up @@ -250,6 +251,7 @@ export function PanelWithForwardedRef({
// CSS selectors
"data-panel": "",
"data-panel-id": panelId,
"data-panel-group-id": groupId,

// e2e test attributes
"data-panel-collapsible": isDevelopment
Expand Down
Loading

1 comment on commit 018a5bd

@vercel
Copy link

@vercel vercel bot commented on 018a5bd Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.