Skip to content

Commit

Permalink
Block Editor: Cleanup AutoBlockPreview render memoization of BlockList (
Browse files Browse the repository at this point in the history
#66060)

Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: sgomes <sergiomdgomes@git.wordpress.org>
  • Loading branch information
4 people authored Oct 11, 2024
1 parent 4f3da91 commit 26dfcb9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/block-editor/src/components/block-preview/auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import EditorStyles from '../editor-styles';
import { store } from '../../store';

// This is used to avoid rendering the block list if the sizes change.
let MemoizedBlockList;
const MemoizedBlockList = memo( BlockList );

const MAX_HEIGHT = 2000;
const EMPTY_ADDITIONAL_STYLES = [];
Expand Down Expand Up @@ -55,9 +55,6 @@ function ScaledBlockPreview( {
return styles;
}, [ styles, additionalStyles ] );

// Initialize on render instead of module top level, to avoid circular dependency issues.
MemoizedBlockList = MemoizedBlockList || memo( BlockList );

const scale = containerWidth / viewportWidth;
const aspectRatio = contentHeight
? containerWidth / ( contentHeight * scale )
Expand Down

1 comment on commit 26dfcb9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 26dfcb9.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11294486742
📝 Reported issues:

Please sign in to comment.