[iOS] [Apple Maps] Marker image prop fails to load under New Architecture (bridgeless mode) in RN >= 0.82
Summary
Since React Native 0.82+ (https://github.com/facebook/react-native/pull/53026) bridgeless mode is enabled by default, both self.bridge (on view managers) and [RCTBridge currentBridge] return nil. This causes marker images set via the image prop to silently fail to load on iOS, because the lookup chain is sent to nil and the entire expression evaluates to nil.
Affected code:
ios/AirMaps/AIRMapMarker.m in setImageSrc:
_reloadImageCancellationBlock = [[[RCTBridge currentBridge] moduleForName:@"ImageLoader"] loadImageWithURLRequest:...Reproduction:
Root cause:
self.bridge and RCTBridge.currentBridge return nil under bridgeless mode. The Fabric component view RNMapsMarkerView does have access to RCTImageLoader via its module registry.
Reproducible sample code
<Marker
coordinate={{ latitude: 37.78, longitude: -122.41 }}
image={require('./assets/flag-pink.png'}
/>Steps to reproduce
- React Native 0.82+ app with New Architecture enabled (the default)
- Install react-native-maps
- Render a with a remote or local image prop
Expected result
Marker renders with the image specified by the image prop, as it does under the old architecture.
Actual result
No marker renders on the map at all
React Native Maps Version
1.27.2
What platforms are you seeing the problem on?
iOS (Apple Maps)
React Native Version
>= 0.82.0
What version of Expo are you using?
Not using Expo
Device(s)
iPhone 14 Pro (26.3.1)
Additional information
No response
Source: react-native-maps/react-native-maps