Skip to content

Commit

Permalink
Revert "Search: Remove unnecessary useEffect (#52604)"
Browse files Browse the repository at this point in the history
This reverts commit 09b083d.
  • Loading branch information
scruffian committed Aug 1, 2023
1 parent 1d9352f commit 73d0687
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,16 @@ export default function SearchEdit( {
);
const { __unstableMarkNextChangeAsNotPersistent } =
useDispatch( blockEditorStore );

if ( insertedInNavigationBlock ) {
useEffect( () => {
if ( ! insertedInNavigationBlock ) return;
// This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
setAttributes( {
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside',
} );
}

}, [ insertedInNavigationBlock ] );
const borderRadius = style?.border?.radius;
const borderProps = useBorderProps( attributes );

Expand Down

0 comments on commit 73d0687

Please sign in to comment.