Skip to content

Commit

Permalink
Improve loopItemsContext logic
Browse files Browse the repository at this point in the history
  • Loading branch information
iansvo committed Dec 12, 2024
1 parent e3c11ef commit 9e61e98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/blocks/looper/components/LoopInnerBlocksRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9e61e98

Please sign in to comment.