mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 20:39:08 +01:00
Fix React warning about missing key in AwaitingSwap
(#9655)
The `AwaitingSwap` component was emitting a React warning when rendered because a component was being rendered in an array without having a `key` prop set. A key has been added to the `CountdownTimer` component, which is passed into the translation helper in an array. The warning no longer appears.
This commit is contained in:
parent
f4838194d6
commit
d43738448c
@ -119,7 +119,14 @@ export default function AwaitingSwap ({
|
||||
|
||||
let countdownText
|
||||
if (timeRemainingIsNumber && !timeRemainingExpired && tradeTxData?.submittedTime) {
|
||||
countdownText = <CountdownTimer timeStarted={tradeTxData?.submittedTime} timerBase={estimatedTransactionWaitTime} timeOnly />
|
||||
countdownText = (
|
||||
<CountdownTimer
|
||||
key="countdown-timer"
|
||||
timeStarted={tradeTxData?.submittedTime}
|
||||
timerBase={estimatedTransactionWaitTime}
|
||||
timeOnly
|
||||
/>
|
||||
)
|
||||
} else if (tradeTxData?.submittedTime) {
|
||||
countdownText = t('swapsAlmostDone')
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user