diff --git a/.changeset/curvy-apes-yawn.md b/.changeset/curvy-apes-yawn.md new file mode 100644 index 0000000000..e38e309850 --- /dev/null +++ b/.changeset/curvy-apes-yawn.md @@ -0,0 +1,5 @@ +--- +'@shopify/h2-test-hydrogen': patch +--- + +Fix a pagination bug on country change diff --git a/templates/demo-store/app/components/Pagination.tsx b/templates/demo-store/app/components/Pagination.tsx index 037e0047dd..4930f24f16 100644 --- a/templates/demo-store/app/components/Pagination.tsx +++ b/templates/demo-store/app/components/Pagination.tsx @@ -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; }