Skip to content

Commit

Permalink
Apply render callback at a slightly higher level.
Browse files Browse the repository at this point in the history
Fixes non-light blocks having the render callback applied inside the Block component rather than outside.

Also moves the "Edit as HTML" form of blocks inside the render callback.
  • Loading branch information
ZebulanStanphill committed Aug 6, 2020
1 parent 904700c commit 312f800
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ function BlockListBlock( {
);
}

if ( renderCallback ) {
blockEdit = renderCallback( blockEdit );
}

const value = {
clientId,
rootClientId,
Expand Down Expand Up @@ -246,6 +242,10 @@ function BlockListBlock( {
block = <Block.div { ...wrapperProps }>{ blockEdit }</Block.div>;
}

if ( renderCallback ) {
block = renderCallback( block );
}

return (
<BlockListBlockContext.Provider value={ memoizedValue }>
<BlockCrashBoundary onError={ onBlockError }>
Expand Down

0 comments on commit 312f800

Please sign in to comment.