diff --git a/plugins/woocommerce-blocks/assets/js/blocks/product-collection/utils.tsx b/plugins/woocommerce-blocks/assets/js/blocks/product-collection/utils.tsx index 4e8ebc23fab5f..6a55dc9212f04 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/product-collection/utils.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/product-collection/utils.tsx @@ -103,15 +103,10 @@ const isInProductArchive = () => { const isFirstBlockThatUsesPageContext = ( property: 'inherit' | 'filterable' ) => { - // We use experimental selector because it's been graduated as stable (`getBlocksByName`) - // in Gutenberg 17.6 (https://github.com/WordPress/gutenberg/pull/58156) and will be - // available in WordPress 6.5. - // Created issue for that: https://github.com/woocommerce/woocommerce/issues/44768. // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore No types for this exist yet, natively. - const { __experimentalGetGlobalBlocksByName, getBlock } = - select( blockEditorStore ); - const productCollectionBlockIDs = __experimentalGetGlobalBlocksByName( + const { getBlocksByName, getBlock } = select( blockEditorStore ); + const productCollectionBlockIDs = getBlocksByName( 'woocommerce/product-collection' ) as string[]; diff --git a/plugins/woocommerce/changelog/51773-product-collection-replace-experimental b/plugins/woocommerce/changelog/51773-product-collection-replace-experimental new file mode 100644 index 0000000000000..e43f1c1c987c1 --- /dev/null +++ b/plugins/woocommerce/changelog/51773-product-collection-replace-experimental @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Replace __experimentalGetGlobalBlocksByName with stable getBlocksByName for Product Collection block \ No newline at end of file