Skip to content

Commit

Permalink
Fix a pagination bug on country change (Shopify#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardlyhel authored Dec 9, 2022
1 parent 4ff9657 commit d2e11a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curvy-apes-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/h2-test-hydrogen': patch
---

Fix a pagination bug on country change
2 changes: 1 addition & 1 deletion templates/demo-store/app/components/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function usePagination(

// the only way to prevent hydration mismatches
useEffect(() => {
if (!state) {
if (!state || !state?.nodes) {
setNodes(connection.nodes);
return;
}
Expand Down

0 comments on commit d2e11a9

Please sign in to comment.