diff --git a/packages/block-editor/src/components/block-list-appender/index.js b/packages/block-editor/src/components/block-list-appender/index.js index 35bf09bb89e66..ddc22b3b928bb 100644 --- a/packages/block-editor/src/components/block-list-appender/index.js +++ b/packages/block-editor/src/components/block-list-appender/index.js @@ -27,7 +27,8 @@ function BlockListAppender( { return null; } - // A render prop has been provided, use it to render the appender. + // If a render prop has been provided + // use it to render the appender. if ( CustomAppender ) { return (
@@ -36,6 +37,11 @@ function BlockListAppender( { ); } + // a false value means, don't render any appender. + if ( CustomAppender === false ) { + return null; + } + // Render the default block appender when renderAppender has not been // provided and the context supports use of the default appender. if ( canInsertDefaultBlock ) { diff --git a/packages/block-editor/src/components/block-preview/index.js b/packages/block-editor/src/components/block-preview/index.js index 2037bc6a0f2ea..3dad6054d6482 100644 --- a/packages/block-editor/src/components/block-preview/index.js +++ b/packages/block-editor/src/components/block-preview/index.js @@ -45,7 +45,7 @@ function BlockPreview( { blocks, settings, className, isScaled } ) { value={ castArray( blocks ) } settings={ settings } > - + ); diff --git a/packages/block-editor/src/components/inner-blocks/README.md b/packages/block-editor/src/components/inner-blocks/README.md index 303e24730f7fe..5bed06f7a8047 100644 --- a/packages/block-editor/src/components/inner-blocks/README.md +++ b/packages/block-editor/src/components/inner-blocks/README.md @@ -177,8 +177,8 @@ If locking is not set in an `InnerBlocks` area: the locking of the parent `Inner If the block is a top level block: the locking of the Custom Post Type is used. ### `renderAppender` -* **Type:** `Function` -* **Default:** - `undefined`. When `renderAppender` is not specific the `` component is as a default. It automatically inserts whichever block is configured as the default block via `wp.blocks.setDefaultBlockName` (typically `paragraph`). +* **Type:** `Function|false` +* **Default:** - `undefined`. When `renderAppender` is not specific the `` component is as a default. It automatically inserts whichever block is configured as the default block via `wp.blocks.setDefaultBlockName` (typically `paragraph`). If a `false` value is provider, no appender is rendered. A 'render prop' function that can be used to customize the block's appender.