Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ function BlockListAppender( {
rootClientId,
canInsertDefaultBlock,
isLocked,
renderAppender,
renderAppender: CustomAppender,
} ) {
if ( isLocked ) {
return null;
}

// A render prop has been provided, use it to render the appender.
if ( renderAppender ) {
if ( CustomAppender ) {
return (
<div className="block-list-appender">
{ renderAppender() }
<CustomAppender />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduth - this is another alternative since JSX desugars to createElement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduth - this is another alternative since JSX desugars to createElement.

I hadn't thought about that, but yes, I think that'd make for a fine (preferred) alternative.

</div>
);
}
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/group/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {
withColors,
} from '@wordpress/block-editor';

const renderAppender = () => <InnerBlocks.ButtonBlockAppender />;

function GroupEdit( {
className,
setBackgroundColor,
Expand Down Expand Up @@ -49,7 +47,7 @@ function GroupEdit( {
</InspectorControls>
<div className={ classes } style={ styles }>
<InnerBlocks
renderAppender={ ! hasInnerBlocks && renderAppender }
renderAppender={ ! hasInnerBlocks && InnerBlocks.ButtonBlockAppender }
/>
</div>
</Fragment>
Expand Down