From 9e61e988516d1201e6cfde192f4ece0d3ca24464 Mon Sep 17 00:00:00 2001 From: Ian Svoboda Date: Thu, 12 Dec 2024 14:53:07 -0500 Subject: [PATCH] Improve loopItemsContext logic --- src/blocks/looper/components/LoopInnerBlocksRenderer.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/looper/components/LoopInnerBlocksRenderer.jsx b/src/blocks/looper/components/LoopInnerBlocksRenderer.jsx index e85802500..f7e9628b2 100644 --- a/src/blocks/looper/components/LoopInnerBlocksRenderer.jsx +++ b/src/blocks/looper/components/LoopInnerBlocksRenderer.jsx @@ -179,7 +179,7 @@ export function LoopInnerBlocksRenderer( props ) { ); const loopItemsContext = useMemo( () => { - if ( hasResolvedData && Array.isArray( data ) ) { + if ( hasResolvedData && data?.length ) { let { posts_per_page: perPage = 10, offset = 0 } = query; // Ensure the params are a valid integer for comparison.