diff --git a/packages/block-editor/src/components/inserter/block-list.js b/packages/block-editor/src/components/inserter/block-list.js index 2964c8efb2a68a..261ee7fb8acfaa 100644 --- a/packages/block-editor/src/components/inserter/block-list.js +++ b/packages/block-editor/src/components/inserter/block-list.js @@ -56,9 +56,11 @@ export function InserterBlockList( { }, [ filterValue, items, categories, collections ] ); const childItems = useMemo( () => { - return filteredItems.filter( ( { name } ) => - rootChildBlocks?.includes( name ) - ); + return rootChildBlocks + ? filteredItems.filter( ( { name } ) => + rootChildBlocks?.includes( name ) + ) + : []; }, [ filteredItems, rootChildBlocks ] ); const suggestedItems = useMemo( () => {