Skip to content

Commit

Permalink
Fix scaleBarEnabled on new arch (#3554)
Browse files Browse the repository at this point in the history
  • Loading branch information
janicduplessis authored Jun 29, 2024
1 parent bdb97cb commit 55216db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions ios/RNMBX/RNMBXFabricPropConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ NSDictionary* RNMBXPropConvert_Optional_NSDictionary(const folly::dynamic &dyn,
_view.name = RNMBXPropConvert_Optional_BOOL_NSNumber(newViewProps.name, @#name); \
}

#define RNMBX_OPTIONAL_PROP_BOOL(name) \
#define RNMBX_REMAP_OPTIONAL_PROP_BOOL(name, viewName) \
if ((!oldProps.get() || oldViewProps.name != newViewProps.name) && !newViewProps.name.isNull()) { \
_view.name = RNMBXPropConvert_Optional_BOOL(newViewProps.name, @#name); \
_view.viewName = RNMBXPropConvert_Optional_BOOL(newViewProps.name, @#name); \
}

#define RNMBX_OPTIONAL_PROP_BOOL(name) RNMBX_REMAP_OPTIONAL_PROP_BOOL(name, name)

#define RNMBX_OPTIONAL_PROP_NSString(name) \
if ((!oldProps.get() || oldViewProps.name != newViewProps.name) && !newViewProps.name.isNull()) { \
_view.name = RNMBXPropConvert_Optional_NSString(newViewProps.name, @#name); \
Expand Down
5 changes: 1 addition & 4 deletions ios/RNMBX/RNMBXMapViewComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
_view.reactCompassImage = compassImage;
}

id scaleBarEnabled = RNMBXConvertFollyDynamicToId(newViewProps.scaleBarEnabled);
if (scaleBarEnabled != nil) {
_view.reactScaleBarEnabled = scaleBarEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(scaleBarEnabled, reactScaleBarEnabled)

id scaleBarPosition = RNMBXConvertFollyDynamicToId(newViewProps.scaleBarPosition);
if (scaleBarPosition != nil) {
Expand Down

0 comments on commit 55216db

Please sign in to comment.