From b1d6c064f43c730d574a92bb317e966e54884d98 Mon Sep 17 00:00:00 2001 From: Krzysztof Ligarski Date: Wed, 26 Nov 2025 07:55:06 +0100 Subject: [PATCH 1/5] override layoutSubviews on Fabric --- .../host/RNSBottomTabsHostComponentView.mm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ios/bottom-tabs/host/RNSBottomTabsHostComponentView.mm b/ios/bottom-tabs/host/RNSBottomTabsHostComponentView.mm index 2e403abcf6..2813e54ad9 100644 --- a/ios/bottom-tabs/host/RNSBottomTabsHostComponentView.mm +++ b/ios/bottom-tabs/host/RNSBottomTabsHostComponentView.mm @@ -155,6 +155,24 @@ - (void)reactAddControllerToClosestParent:(UIViewController *)controller } } +#if RCT_NEW_ARCH_ENABLED + +// On Fabric, when tabs are rendered dynamically, tab screens receive incorrect frame from UIKit layout +// (frame matches full window size instead of the size of the host). To mitigate this, we override +// `layoutSubviews` and assign correct frame ourselves. +// TODO: investigate why we receive incorrect frame, fix and remove this workaround +- (void)layoutSubviews +{ + RCTAssert( + self.subviews.count == 1, + @"[RNScreens] Incorrect number of subviews in RNSBottomTabsHostComponentView. Expected 1, actual: %lu.", + static_cast(self.subviews.count)); + + [self.subviews[0] setFrame:self.bounds]; +} + +#endif // RCT_NEW_ARCH_ENABLED + #pragma mark - RNSScreenContainerDelegate - (void)updateContainer From 9e6b26efb1ad659da08bef0a144e68a2cc07e8ea Mon Sep 17 00:00:00 2001 From: Krzysztof Ligarski Date: Wed, 26 Nov 2025 13:22:17 +0100 Subject: [PATCH 2/5] add test screen --- apps/src/tests/Test3425.tsx | 33 +++++++++++++++++++++++++++++++++ apps/src/tests/index.ts | 1 + 2 files changed, 34 insertions(+) create mode 100644 apps/src/tests/Test3425.tsx diff --git a/apps/src/tests/Test3425.tsx b/apps/src/tests/Test3425.tsx new file mode 100644 index 0000000000..fd17edc867 --- /dev/null +++ b/apps/src/tests/Test3425.tsx @@ -0,0 +1,33 @@ +import React, { useState } from 'react'; +import { enableFreeze } from 'react-native-screens'; +import { Button, View } from 'react-native'; +import Colors from '../shared/styling/Colors'; +import { TestBottomTabs } from '.'; + +enableFreeze(true); + +export default function App() { + const [index, setIndex] = useState(0); + return ( + + {index === 0 ? ( + +