[iOS] Avoid unnecessary string allocations#3499
Conversation
We'd like to take a closer look into this issue. Sure, setting max depth is a solution, but maybe we will be able to figure out how to fix it in a better way. Given that, we will do this in another PR. Also it would be great if you could provide a reproduction (if possible). If you need these changes asap, you can make a patch which reverts this commit. This is where these changes were introduced, so reverting it should make it work again. |
|
I fixed the recursion issue for now by just providing an accessibilityLabel to every RectButton, so I’m good and don't need a patch. But I saw a few people on X saying they ran into the same issue, so it might affect more people. I'll try my best to come up with a repro but this is a tough one for sure. |
|
FYI, the issue is reproducible with |

Description
#3290 introduced recursive algorithm to obtain accessibility label from children. However, unlike in React Native, it allocates
Stringat every recursive call. This may lower the performance as those allocations come at high cost.Test plan
Accessibility labels are inferred as before.