diff --git a/docs/reference-guides/data/data-core-block-editor.md b/docs/reference-guides/data/data-core-block-editor.md index e0e9695a0036..4c16e90441c4 100644 --- a/docs/reference-guides/data/data-core-block-editor.md +++ b/docs/reference-guides/data/data-core-block-editor.md @@ -1471,11 +1471,11 @@ _Parameters_ ### setBlockVisibility -Action that sets whether a block has controlled inner blocks. +Action that sets whether given blocks are visible on the canvas. _Parameters_ -- _updates_ `Record`: The block's clientId. +- _updates_ `Record`: For each block's clientId, its new visibility setting. ### setHasControlledInnerBlocks diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index afb93c40c5d9..4b117bd5e9bd 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -1605,9 +1605,9 @@ export function setHasControlledInnerBlocks( } /** - * Action that sets whether a block has controlled inner blocks. + * Action that sets whether given blocks are visible on the canvas. * - * @param {Record} updates The block's clientId. + * @param {Record} updates For each block's clientId, its new visibility setting. */ export function setBlockVisibility( updates ) { return { diff --git a/packages/components/src/autocomplete/index.js b/packages/components/src/autocomplete/index.js index ff858e7fdc9e..3b052d826e8a 100644 --- a/packages/components/src/autocomplete/index.js +++ b/packages/components/src/autocomplete/index.js @@ -269,6 +269,9 @@ function useAutocomplete( { event.preventDefault(); } + // textContent is a primitive (string), memoizing is not strictly necessary + // but this is a preemptive performance improvement, since the autocompleter + // is a potential bottleneck for the editor type metric. const textContent = useMemo( () => { if ( isCollapsed( record ) ) { return getTextContent( slice( record, 0 ) );