Skip to content

Commit ea83410

Browse files
fix(ios): guard +load with #ifdef RCT_DYNAMIC_FRAMEWORKS (#4047)
## Summary The `+load` method in `RNGestureHandlerButtonComponentView` is unconditional, but its parent `RCTViewComponentView` correctly guards its `+load` behind `#ifdef RCT_DYNAMIC_FRAMEWORKS`. Without the guard, the child's `+load` runs even when dynamic frameworks are not used, causing conflicts with third-party SDKs (e.g. Akamai BMP) that also use `+load` — particularly on x86_64 simulators where the load order differs from arm64. This matches the pattern used by React Native core in `RCTViewComponentView.mm` (see facebook/react-native#37274). ## Test plan - Build xcframework with static linking (no `USE_FRAMEWORKS=dynamic`) - Verify `RNGestureHandlerButtonComponentView +load` is not in the binary (`nm` check) - Run on x86_64 simulator alongside Akamai BMP — no crash at launch - Run on arm64 simulator — gesture handler works normally
1 parent 1e87668 commit ea83410

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ + (BOOL)shouldBeRecycled
4545
#endif
4646

4747
// Needed because of this: https://github.com/facebook/react-native/pull/37274
48+
#ifdef RCT_DYNAMIC_FRAMEWORKS
4849
+ (void)load
4950
{
5051
[super load];
5152
}
53+
#endif
5254

5355
- (instancetype)initWithFrame:(CGRect)frame
5456
{

0 commit comments

Comments
 (0)