Skip to content

Commit ad640d7

Browse files
committed
Fix infinite loop for iOS
`dataLocal` as a dependency was causing an infinite loop for iOS repeatedly clearing the data every 500ms. The rendering hacks need only trigger once on mount. Delay also reduced to be less perceptible.
1 parent 1b770db commit ad640d7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- added: Add PIVX.
66
- added: Monero multi output support.
77
- added: Moonpay Sell support for ACH.
8+
- fixed: iOS not immediately showing `EdgeCarousel` cards if only one card is present
89

910
## 4.26.0 (2025-04-14)
1011

src/components/common/EdgeCarousel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function EdgeCarousel<T>(props: Props<T>): JSX.Element {
5050
setDataLocal([])
5151
setTimeout(() => {
5252
setDataLocal(tempData)
53-
}, 500)
53+
}, 50)
5454
}
5555
// The built-in hack fn works for all other cases
5656
else if (carouselRef.current != null) {
@@ -59,7 +59,7 @@ export function EdgeCarousel<T>(props: Props<T>): JSX.Element {
5959
})
6060
}
6161
},
62-
[dataLocal], // Depend on dataLocal instead of data to avoid infinite loops
62+
[data],
6363
'triggerRenderingHack'
6464
)
6565

0 commit comments

Comments
 (0)