Editor: Simplify block context to eliminate createInnerBlockList #6943
Labels
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
[Type] Code Quality
Issues or PRs that relate to code quality
[Type] Performance
Related to performance efforts
[Type] Task
Issues or PRs that have been broken down into an individual action to take
The
createInnerBlockList
function was originally added as part of #5228 in a compromise to allow a block (at the time, inblocks
) to render aBlockList
component viaInnerBlocks
, avoiding a circular dependency† betweenblocks
andeditor
by passing the higher-order component through via Reactcontext
.Between core blocks being moved to their own directory (#6351) and blocks components being merged into editor (#6521), the dependency hierarchy has changed such that
InnerBlocks
(now in./editor
) can render a BlockList on its own. It only needs the props which are expected by the component (rootUID
,renderBlockMenu
). These values are simpler to pass through as context, and avoids the need forcreateInnerBlockList
(and related caching) altogether.† Where the dependencies would look as:
BlockList (
./editor
) -> Block (./blocks
) -> InnerBlocks (./blocks
) -> BlockList (./editor
)The text was updated successfully, but these errors were encountered: