diff --git a/packages/block-library/src/comment-template/edit.js b/packages/block-library/src/comment-template/edit.js index 21a88d20c85c2e..92ed8e55074517 100644 --- a/packages/block-library/src/comment-template/edit.js +++ b/packages/block-library/src/comment-template/edit.js @@ -1,15 +1,15 @@ /** * WordPress dependencies */ -import { useState, useMemo } from '@wordpress/element'; +import { useState, useMemo, memo } from '@wordpress/element'; import { useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; import { BlockContextProvider, - BlockPreview, useBlockProps, useInnerBlocksProps, store as blockEditorStore, + __experimentalUseBlockPreview as useBlockPreview, } from '@wordpress/block-editor'; import { Spinner } from '@wordpress/components'; import { store as coreStore } from '@wordpress/core-data'; @@ -35,7 +35,7 @@ const TEMPLATE = [ * @param {Array} [props.comment] - A comment object. * @param {Array} [props.activeComment] - The block that is currently active. * @param {Array} [props.setActiveComment] - The setter for activeComment. - * @param {Array} [props.firstBlock] - First comment in the array. + * @param {Array} [props.firstComment] - First comment in the array. * @param {Array} [props.blocks] - Array of blocks returned from * getBlocks() in parent . * @return {WPElement} Inner blocks of the Comment Template @@ -44,7 +44,7 @@ function CommentTemplateInnerBlocks( { comment, activeComment, setActiveComment, - firstBlock, + firstComment, blocks, } ) { const { children, ...innerBlocksProps } = useInnerBlocksProps( @@ -53,15 +53,22 @@ function CommentTemplateInnerBlocks( { ); return (