From 6e4df9b6af6ba21b62a468512fe2bedba49ac574 Mon Sep 17 00:00:00 2001 From: scharron Date: Tue, 24 Jun 2025 16:22:53 +0200 Subject: [PATCH] Fix #3889 : With react new arch, allowOverlap is always true This bug appears using the new react architecture. This is because of the id allowOverlap = RNMBXConvertFollyDynamicToId(newProps.allowOverlap); conversions that returns a pointer that is always true instead of the value of the pointed object according to #3730 --- ios/RNMBX/RNMBXMarkerViewComponentView.mm | 27 +++++++++-------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/ios/RNMBX/RNMBXMarkerViewComponentView.mm b/ios/RNMBX/RNMBXMarkerViewComponentView.mm index 17ce30770c..31ad30ba2b 100644 --- a/ios/RNMBX/RNMBXMarkerViewComponentView.mm +++ b/ios/RNMBX/RNMBXMarkerViewComponentView.mm @@ -11,6 +11,8 @@ #import #import +#import "RNMBXFabricPropConvert.h" + using namespace facebook::react; @interface RNMBXMarkerViewComponentView () @@ -68,28 +70,21 @@ + (ComponentDescriptorProvider)componentDescriptorProvider - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps { - const auto &newProps = static_cast(*props); - - id coordinate = RNMBXConvertFollyDynamicToId(newProps.coordinate); + const auto &newViewProps = static_cast(*props); + const auto &oldViewProps = + static_cast(*oldProps); + + id coordinate = RNMBXConvertFollyDynamicToId(newViewProps.coordinate); if (coordinate != nil) { _view.coordinate = coordinate; } - id anchor = RNMBXConvertFollyDynamicToId(newProps.anchor); + id anchor = RNMBXConvertFollyDynamicToId(newViewProps.anchor); if (anchor != nil) { _view.anchor = anchor; } - id allowOverlap = RNMBXConvertFollyDynamicToId(newProps.allowOverlap); - if (allowOverlap != nil) { - _view.allowOverlap = allowOverlap; - } - id allowOverlapWithPuck = RNMBXConvertFollyDynamicToId(newProps.allowOverlapWithPuck); - if (allowOverlapWithPuck != nil) { - _view.allowOverlapWithPuck = allowOverlapWithPuck; - } - id isSelected = RNMBXConvertFollyDynamicToId(newProps.isSelected); - if (isSelected != nil) { - _view.isSelected = isSelected; - } + RNMBX_REMAP_OPTIONAL_PROP_BOOL(allowOverlap, allowOverlap); + RNMBX_REMAP_OPTIONAL_PROP_BOOL(allowOverlapWithPuck, allowOverlapWithPuck); + RNMBX_REMAP_OPTIONAL_PROP_BOOL(isSelected, isSelected); [super updateProps:props oldProps:oldProps]; }