Skip to content

Commit

Permalink
Fix infinite loop on 404 page (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle authored Nov 14, 2022
1 parent 3d87db3 commit 1ee6ab2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions templates/demo-store/app/components/FeaturedSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ export interface FeaturedData {
}

export function FeaturedSection() {
const featuredProductsFetcher = useFetcher();
const {load, data} = useFetcher();
const path = usePrefixPathWithLocale('/featured-products');

useEffect(() => {
featuredProductsFetcher.load(path);
}, [featuredProductsFetcher, path]);
load(path);
}, [load, path]);

if (!featuredProductsFetcher.data) return null;
if (!data) return null;

const {featuredCollections, featuredProducts} =
featuredProductsFetcher.data as FeaturedData;
const {featuredCollections, featuredProducts} = data as FeaturedData;

return (
<>
Expand Down

0 comments on commit 1ee6ab2

Please sign in to comment.