Skip to content

Commit

Permalink
fix: issues with incorrect props to memo
Browse files Browse the repository at this point in the history
  • Loading branch information
petertonysmith94 committed Jan 9, 2024
1 parent 3affc5c commit 824432c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/socials.component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from "react";
import { IColor, ISize, Social } from "../types";
import type { IColor, ISize, Social } from "../types";
import { SocialLink } from "./app-content.styles";

const SocialComponent = ({ name, url, size, color, icon: IconComponent }: Social & IColor & ISize) => (
Expand All @@ -15,7 +15,7 @@ const SocialComponent = ({ name, url, size, color, icon: IconComponent }: Socia
export const Socials = ({ socials, color, size }: { socials: Array<Social> } & IColor & ISize) => {
const Components = useMemo(() => socials.map(
(social, index) => <SocialComponent key={`social-${index}`} {...social} color={color} size={size} />
), [socials])
), [socials, color, size])

return (<>{ Components }</>)
}

0 comments on commit 824432c

Please sign in to comment.