Skip to content

Commit

Permalink
Tidy up settings useMemo
Browse files Browse the repository at this point in the history
Co-authored-by: Ramon <ramonjd@users.noreply.github.com>
  • Loading branch information
andrewserong and ramonjd committed Dec 9, 2021
1 parent 7e47d5a commit a00533e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/block-editor/src/components/block-preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ export function useBlockPreview( {
);
const disabledRef = useDisabled();
const ref = useMergeRefs( [ props.ref, disabledRef ] );
const settings = useMemo( () => {
const _settings = { ...originalSettings };
_settings.__experimentalBlockPatterns = [];
return _settings;
}, [ originalSettings ] );
const settings = useMemo(
() => ( { ...originalSettings, __experimentalBlockPatterns: [] } ),
[ originalSettings ]
);
const renderedBlocks = useMemo( () => castArray( blocks ), [ blocks ] );

const children = (
Expand Down

0 comments on commit a00533e

Please sign in to comment.