Repository navigation
Conversation
The return inside forEach only left the closure, so every <Images> was still checked and onImageMissing fired even after one of them had added the image. Use a for-in loop so the handler returns, matching Android.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the iOS
styleImageMissinghandler, thereturninsideself.images.forEach { ... }only left the closure. The handler kept checking every<Images>and then sentonImageMissingeven when one of them had already added the image. This switches to afor-inloop so the handler returns at the first<Images>that supplies the image, which matches Android (return@OnStyleImageMissingListener).onImageMissingnow fires only when no<Images>has the image.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Screenshot OR Video
Reproduced on the iOS simulator (iPhone 17, iOS 26.5). Two
<Images>both supplyfoo. Unmounting B removesfoofrom the style. The next shape update makes the map reportfoomissing, and A re-adds it throughaddMissingImageToStyle.Before: after 11 B toggles (6 unmounts),
onImageMissingfired 6 times forfoo, the image A had just re-added. After: same 11 toggles, 0 events forfoo.missing-bar, which nobody supplies, is still reported in both builds. Native logging confirmed the map raisedstyleImageMissing foo6 times in each run, so only the JS event differs.Component to reproduce the issue you're fixing
Press "Unmount B" / "Mount B" a few times. On the unfixed build, the
foocounter goes up and the result reads FAIL. On the fixed build it stays at 0 and reads PASS.Repro.tsx