From e804b92f30eff2a4218fb01ffa05d23e26668b00 Mon Sep 17 00:00:00 2001 From: Shisuys Date: Sat, 11 Jan 2025 11:50:22 -0300 Subject: [PATCH] Update game-card.tsx --- src/renderer/src/components/game-card/game-card.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/game-card/game-card.tsx b/src/renderer/src/components/game-card/game-card.tsx index 95f15a8e..7960fb6e 100644 --- a/src/renderer/src/components/game-card/game-card.tsx +++ b/src/renderer/src/components/game-card/game-card.tsx @@ -9,6 +9,7 @@ import { Badge } from "../badge/badge"; import { useCallback, useState } from "react"; import { useFormat, useRepacks } from "@renderer/hooks"; import { steamUrlBuilder } from "@shared"; +import { useMemo } from "react"; export interface GameCardProps extends React.DetailedHTMLProps< @@ -44,8 +45,8 @@ export function GameCard({ game, ...props }: GameCardProps) { const { numberFormatter } = useFormat(); - const firstThreeRepackers = uniqueRepackers.slice(0, 3); - const remainingCount = uniqueRepackers.length - 3; + const firstThreeRepackers = useMemo(() => uniqueRepackers.slice(0, 3), [uniqueRepackers]); + const remainingCount = useMemo(() => uniqueRepackers.length - 3, [uniqueRepackers]); return (