🚨(frontend) resolve key prop warning in ParticipantListItem

Key prop was incorrectly passed down as a regular prop to ParticipantListItem
instead of being used at the array mapping level. Key is a special React prop
for list rendering and cannot be accessed as a component prop.
This commit is contained in:
lebaudantoine
2025-01-16 12:10:45 +01:00
committed by aleb_the_flash
parent 36ea44befc
commit f17471dae5
2 changed files with 8 additions and 3 deletions

View File

@@ -118,7 +118,6 @@ export const ParticipantListItem = ({
<HStack
role="listitem"
justify="space-between"
key={participant.identity}
id={participant.identity}
className={css({
padding: '0.25rem 0',

View File

@@ -56,7 +56,10 @@ export const ParticipantsList = () => {
heading={t('raisedHands')}
participants={raisedHandParticipants}
renderParticipant={(participant) => (
<HandRaisedListItem participant={participant} />
<HandRaisedListItem
key={participant.identity}
participant={participant}
/>
)}
action={() => (
<LowerAllHandsButton participants={raisedHandParticipants} />
@@ -68,7 +71,10 @@ export const ParticipantsList = () => {
heading={t('contributors')}
participants={sortedParticipants}
renderParticipant={(participant) => (
<ParticipantListItem participant={participant} />
<ParticipantListItem
key={participant.identity}
participant={participant}
/>
)}
/>
</Div>