From 29375a98c312aefc52c77ad6a6bfdeac67bd187e Mon Sep 17 00:00:00 2001 From: Jonas Simoen Date: Sun, 22 Oct 2023 19:08:00 +0200 Subject: [PATCH] fix(team): error null-properties --- src/pages/Team/Team.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Team/Team.tsx b/src/pages/Team/Team.tsx index 3e900cd..bad1d53 100644 --- a/src/pages/Team/Team.tsx +++ b/src/pages/Team/Team.tsx @@ -62,7 +62,7 @@ export const _Team = (props: AbstractTeamType) => { return Object.assign({ inStarting: false, upcomingMatches: displayWeekMatches }, pick(p, playerProps), pick(p.selection, selectionProps)); }); - const teamName = teamResult.team.name; + const teamName = useMemo(() => teamResult && teamResult.team.name, [teamResult]); const captainPlayer = teamResult.players.find((p: Player) => p && p.selection && p.selection.captain === 1); const captainId = captainPlayer && captainPlayer.id;