Skip to content

Commit

Permalink
Optimize check for nullish rootChildBlocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebulanStanphill committed Apr 22, 2020
1 parent 27deb2e commit 11c3227
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-editor/src/components/inserter/block-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ function InserterBlockList( {
}, [ filterValue, items, categories, collections ] );

const childItems = useMemo( () => {
return filter( filteredItems, ( { name } ) =>
rootChildBlocks?.includes( name )
);
return rootChildBlocks
? filter( filteredItems, ( { name } ) =>
rootChildBlocks.includes( name )
)
: [];
}, [ filteredItems, rootChildBlocks ] );

const suggestedItems = useMemo( () => {
Expand Down

0 comments on commit 11c3227

Please sign in to comment.