Skip to content

Commit

Permalink
Search: Remove unnecessary useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Jul 13, 2023
1 parent 800cd8c commit 47409a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,17 @@ export default function SearchEdit( {
);
const { __unstableMarkNextChangeAsNotPersistent } =
useDispatch( blockEditorStore );
useEffect( () => {
if ( ! insertedInNavigationBlock ) return;

if ( insertedInNavigationBlock ) {
// 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 47409a7

Please sign in to comment.