Skip to content

Commit

Permalink
Editor: Use a stable array ref as fallback value in 'BlockVisibility' (
Browse files Browse the repository at this point in the history
…WordPress#69288)

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Feb 24, 2025
1 parent 74a2ba4 commit d181ce4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { store as editorStore } from '../../store';
import { unlock } from '../../lock-unlock';

const { BlockManager } = unlock( blockEditorPrivateApis );
const EMPTY_ARRAY = [];

export default function BlockVisibility() {
const { showBlockTypes, hideBlockTypes } = unlock(
Expand All @@ -31,7 +32,7 @@ export default function BlockVisibility() {
select( editorStore ).getEditorSettings().allowedBlockTypes,
hiddenBlockTypes:
select( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??
[],
EMPTY_ARRAY,
};
}, [] );

Expand Down

0 comments on commit d181ce4

Please sign in to comment.