diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js index 98f35cdd023279..9406a3a0618f4d 100644 --- a/packages/block-library/src/latest-posts/edit.js +++ b/packages/block-library/src/latest-posts/edit.js @@ -229,6 +229,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { }; }, [] ); + const hasPosts = !! latestPosts?.length; const inspectorControls = ( @@ -412,7 +413,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { } ), } ); - const hasPosts = Array.isArray( latestPosts ) && latestPosts.length; if ( ! hasPosts ) { return (