Skip to content

Commit

Permalink
Use static 'key' when filtering BlockEdit components (WordPress#63590)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people committed Jul 16, 2024
1 parent 1fa4384 commit e64a666
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/customize-widgets/src/filters/move-to-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const withMoveToSidebarToolbarItem = createHigherOrderComponent(

return (
<>
<BlockEdit { ...props } />
<BlockEdit key="edit" { ...props } />
{ hasMultipleSidebars && canInsertBlockInSidebar && (
<BlockControls>
<MoveToWidgetArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const withWideWidgetDisplay = createHigherOrderComponent(
( widget ) => widget.id_base === idBase
)?.is_wide ?? false;

return <BlockEdit { ...props } isWide={ isWide } />;
return <BlockEdit key="edit" { ...props } isWide={ isWide } />;
},
'withWideWidgetDisplay'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function PushChangesToGlobalStyles( props ) {
const withPushChangesToGlobalStyles = createHigherOrderComponent(
( BlockEdit ) => ( props ) => (
<>
<BlockEdit { ...props } />
<BlockEdit key="edit" { ...props } />
{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }
</>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-widgets/src/filters/move-to-widget-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const withMoveToWidgetAreaToolbarItem = createHigherOrderComponent(

return (
<>
<BlockEdit { ...props } />
<BlockEdit key="edit" { ...props } />
{ isMoveToWidgetAreaVisible && (
<BlockControls>
<MoveToWidgetArea
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/hooks/pattern-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const withPatternOverrideControls = createHigherOrderComponent(

return (
<>
<BlockEdit { ...props } />
<BlockEdit key="edit" { ...props } />
{ props.isSelected && isSupportedBlock && (
<ControlsWithStoreSubscription { ...props } />
) }
Expand Down

0 comments on commit e64a666

Please sign in to comment.