From 075f8e45d3a5bd032487cc471dbc78cba44b6062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 8 Apr 2026 16:55:25 +0200 Subject: [PATCH 1/2] Do not pass index to unmount --- .../apple/RNGestureHandlerButtonComponentView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm b/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm index 196c41aa07..b4bc53b8be 100644 --- a/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm +++ b/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm @@ -74,7 +74,7 @@ - (void)mountChildComponentView:(RNGHUIView *)childCom - (void)unmountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index { - [_buttonView unmountChildComponentView:childComponentView index:index]; + [childComponentView removeFromSuperview]; } - (LayoutMetrics)buildWrapperMetrics:(const LayoutMetrics &)metrics From 886be0a23663c8b8515a1bdeefb2dfad8292e0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Thu, 9 Apr 2026 07:59:31 +0200 Subject: [PATCH 2/2] Guard before removing --- .../apple/RNGestureHandlerButtonComponentView.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm b/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm index b4bc53b8be..f144fb444d 100644 --- a/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm +++ b/packages/react-native-gesture-handler/apple/RNGestureHandlerButtonComponentView.mm @@ -72,9 +72,12 @@ - (void)mountChildComponentView:(RNGHUIView *)childCom [_buttonView mountChildComponentView:childComponentView index:index]; } -- (void)unmountChildComponentView:(RNGHUIView *)childComponentView index:(NSInteger)index +- (void)unmountChildComponentView:(RNGHUIView *)childComponentView + index:(NSInteger)__unused index { - [childComponentView removeFromSuperview]; + if (childComponentView.superview == _buttonView) { + [childComponentView removeFromSuperview]; + } } - (LayoutMetrics)buildWrapperMetrics:(const LayoutMetrics &)metrics