Skip to content

Commit

Permalink
Block Editor: Align Hook: Pass empty deps to useSelect (#19008)
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored and youknowriad committed Dec 9, 2019
1 parent 1e21c7b commit 8647dbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/block-editor/src/hooks/align.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ export const withToolbarControls = createHigherOrderComponent(
export const withDataAlign = createHigherOrderComponent( ( BlockListBlock ) => ( props ) => {
const { name, attributes } = props;
const { align } = attributes;
const hasWideEnabled = useSelect( ( select ) => (
!! select( 'core/block-editor' ).getSettings().alignWide
) );
const hasWideEnabled = useSelect(
( select ) => !! select( 'core/block-editor' ).getSettings().alignWide,
[]
);

// If an alignment is not assigned, there's no need to go through the
// effort to validate or assign its value.
Expand Down

0 comments on commit 8647dbf

Please sign in to comment.