diff --git a/components/layout/sections/contributors.tsx b/components/layout/sections/contributors.tsx index 0e25a5a..1aacaae 100644 --- a/components/layout/sections/contributors.tsx +++ b/components/layout/sections/contributors.tsx @@ -1,6 +1,6 @@ 'use client' -import { useEffect, useState, memo } from 'react' +import { useEffect, useState, memo, useMemo } from 'react' import { GithubIcon } from 'lucide-react' import Link from 'next/link' @@ -22,6 +22,8 @@ export const ContributorsSection = () => { .finally(() => setLoading(false)) }, []) + const memorizedContributors = useMemo(() => contributors, [contributors]) + return (
@@ -48,7 +50,7 @@ export const ContributorsSection = () => { ) : ( <> - {contributors.map((contributor) => ( + {memorizedContributors.map((contributor) => ( ))} diff --git a/components/layout/sections/products.tsx b/components/layout/sections/products.tsx index b3911db..05111eb 100644 --- a/components/layout/sections/products.tsx +++ b/components/layout/sections/products.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState, useEffect, memo } from 'react' +import { useState, useEffect, memo, useMemo } from 'react' import Image from 'next/image' import Link from 'next/link' import { GithubIcon } from 'lucide-react' @@ -27,6 +27,8 @@ export const ProductsSection = () => { .finally(() => setLoading(false)) }, []) + const memorizedRepos = useMemo(() => repos, [repos]) + return (
@@ -63,7 +65,7 @@ export const ProductsSection = () => { ) : ( <> - {repos.map((repo) => ( + {memorizedRepos.map((repo) => ( ))}