Skip to content

Commit

Permalink
Block Editor: use shallow memo for prioritized inserter blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Sep 30, 2024
1 parent 5e47d48 commit 4958b9b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { useLayoutEffect, useMemo, useState } from '@wordpress/element';
import { useLayoutEffect, useState } from '@wordpress/element';
import { useRegistry } from '@wordpress/data';
import deprecated from '@wordpress/deprecated';
import isShallowEqual from '@wordpress/is-shallow-equal';
Expand Down Expand Up @@ -77,10 +77,7 @@ export default function useNestedSettingsUpdate(
// otherwise if the arrays change length but the first elements are equal the comparison,
// does not works as expected.
const _allowedBlocks = useShallowMemo( allowedBlocks );

const _prioritizedInserterBlocks = useMemo(
() => prioritizedInserterBlocks,
// eslint-disable-next-line react-hooks/exhaustive-deps
const _prioritizedInserterBlocks = useShallowMemo(
prioritizedInserterBlocks
);

Expand Down

0 comments on commit 4958b9b

Please sign in to comment.