Skip to content

Commit

Permalink
fix: Use event.id as key instead of useId
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroWave022 committed Oct 28, 2024
1 parent fc6d96a commit e19585e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/[locale]/(default)/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getTranslations, setRequestLocale } from 'next-intl/server';

// TODO: Must be replaced with actual events
import { events } from '@/mock-data/events';
import { useId } from 'react';

export async function generateMetadata({
params,
Expand Down Expand Up @@ -32,7 +31,7 @@ export default async function EventsPage({
<h2 className='my-2'>Active events</h2>
{events.slice(0, 1).map((event) => (
<EventCard
key={useId()}
key={event.id}
id={event.id}
title={event.title}
subheader={event.subheader}
Expand All @@ -47,7 +46,7 @@ export default async function EventsPage({
<div className='grid grid-cols-1 gap-2 lg:grid-cols-2'>
{events.slice(1, 5).map((event) => (
<EventCard
key={useId()}
key={event.id}
id={event.id}
title={event.title}
subheader={event.subheader}
Expand All @@ -64,7 +63,7 @@ export default async function EventsPage({
<div className='grid grid-cols-1 gap-2 lg:grid-cols-2'>
{events.slice(5).map((event) => (
<EventCard
key={useId()}
key={event.id}
id={event.id}
title={event.title}
subheader={event.subheader}
Expand Down

0 comments on commit e19585e

Please sign in to comment.