From a9e403c0be16f71f008c3734ffdb254e99c7d5b9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 18 Aug 2021 11:41:18 +0100 Subject: [PATCH] Define parent in registerCheckoutBlock (https://github.com/woocommerce/woocommerce-blocks/pull/4591) --- .../packages/checkout/blocks-registry/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/woocommerce-blocks/packages/checkout/blocks-registry/index.ts b/plugins/woocommerce-blocks/packages/checkout/blocks-registry/index.ts index 30d5dc71e0d..111d6540632 100644 --- a/plugins/woocommerce-blocks/packages/checkout/blocks-registry/index.ts +++ b/plugins/woocommerce-blocks/packages/checkout/blocks-registry/index.ts @@ -175,18 +175,28 @@ export const registerCheckoutBlock = ( assertOption( options, 'areas', 'array' ); assertBlockComponent( options, 'component' ); + /** + * If provided with a configuration object, this registers the block with WordPress. + */ if ( options?.configuration ) { assertOption( options, 'configuration', 'object' ); registerExperimentalBlockType( blockName, { ...options.configuration, category: 'woocommerce', + parent: [], } ); } + /** + * This enables the inner block within specific areas. See RegisteredBlocks. + */ options.areas.forEach( ( area ) => registerBlockForArea( area, blockName ) ); + /** + * This ensures the frontend component for the checkout block is available. + */ registerBlockComponent( { blockName, component: options.component,