[iOS][Apple Maps][New Arch] Changing one Marker's zIndex blanks every other marker on screen for ~2 frames
Summary
On iOS + Apple Maps (PROVIDER_DEFAULT) + New Architecture, changing one <Marker>'s zIndex prop makes every other marker on screen blank for about two frames. The change causes Fabric to treat the marker as a sibling reorder (remove + re-insert of the annotation), and MKMapView re-lays out all annotation views on any add/remove.
This is the Apple Maps counterpart of #5981 (which reports sibling flicker on the Google provider for move mutations of the children array). Here no array reorder is needed: a zIndex prop change on a single marker is enough.
Reproducible sample code
const [selected, setSelected] = useState<string | null>(null)
// ...
{pins.map((p) => (
<Marker key={p.id} coordinate={p.coordinate} zIndex={p.id === selected ? 999 : 1} onPress={() => setSelected(p.id)}>
<PinView />
</Marker>
))}Steps to reproduce
- Render ~40 custom-view markers in view.
- Tap one so only its
zIndexprop changes. - Record the screen (a frame-difference filter over a cluster of untouched pins makes it obvious).
Expected result
Only the tapped marker changes.
Actual result
Every other pin disappears for ~2 frames and reappears. Lifting by 1000 instead of 999999 flashes the same, so it is not the magnitude; leaving zIndex alone does not flash.
Workaround
Never change a mounted marker's zIndex. Highlight the selected pin with a separate marker mounted at a high zIndex (we mount an overlay marker at 999999 keyed on the selected id): a fresh annotation added on top does not trigger the relayout of its siblings, a reordered one does.
React Native Maps Version
1.29.0 (behaviour unchanged on v1.29.2)
What platforms are you seeing the problem on?
iOS (Apple Maps), New Architecture
React Native Version
0.86 (Expo SDK 57)
Device(s)
iPhone 17 Pro simulator (iOS 26.5), iPhone hardware
Additional information
Measured with a live XCTest that mounts a harness root on the app's own RCTSurfacePresenter and counts willMoveToWindow: on every annotation view: changing one pin's zIndex detaches the neighbours' views; adding an overlay marker detaches none. A full write-up will be at https://zackdesign.biz/which-pin-did-you-tap/ shortly.
Source: react-native-maps/react-native-maps