Skip to content

Commit

Permalink
add key to leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Feb 26, 2024
1 parent 15ced27 commit 372c3cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default async function Leaderboard() {
const users = await getLeaderboardUsers();

const rows = users.map((user, i) => (
<LeaderboardRow user={user} rank={i + 1} />
<LeaderboardRow key={i} user={user} rank={i + 1} />
));

return (
Expand Down
2 changes: 1 addition & 1 deletion components/LeaderboardRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function LeaderboardRow({
}

return (
<tr key={user.name} className="hover" onClick={() => onClick()}>
<tr className="hover" onClick={() => onClick()}>
<th>{rank}</th>
<th>{user.name}</th>
<td>{user.kills}</td>
Expand Down

0 comments on commit 372c3cd

Please sign in to comment.