Repository navigation
Conversation
`RNTesterTabsIOSComponentView` installed its `UITabBarController`'s view as its content view when it was created, so the view entered the window with the component, and the controller became a child of the view controller above only afterwards, in `didMoveToWindow`. UIKit's containment rules ask for the opposite order. On a physical iPhone Duo with iOS 27.2, launched unfolded, RNTester sometimes came up with no tab items until it was sent to the background and back. A likely cause is that the tab bar was laid out once by a controller with no parent and again once it had one. That mechanism is inferred, not confirmed. Install the view only while the controller is a child, in the order UIKit documents for container view controllers: `didMoveToWindow` adds the controller to the view controller above, sizes and installs its view, then calls `didMoveToParentViewController:`, and reverses that when the component leaves the window. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
RNTester's iOS tabs are a
UITabBarControllerhosted inRNTesterTabsIOSComponentView. The component installed the controller's view as its content view when it was created, so the view entered the window with the component, and the controller became a child of the view controller above only afterwards, in the component'sdidMoveToWindow. UIKit's containment rules ask for the opposite order: the controller becomes a child before its view is added.On a physical iPhone Duo with iOS 27.2, launched unfolded, RNTester sometimes came up with no tab items until it was sent to the background and back. A likely cause is that the side tab bar was laid out once by a controller with no parent and again once it had one. That mechanism is inferred from the code and the symptom; it was not confirmed, and this branch alone has not been run on that device.
This change installs the view only while the controller is a child, in the order UIKit documents for container view controllers:
didMoveToWindowadds the controller to the view controller above, sizes and installs its view, then callsdidMoveToParentViewController:, and reverses that when the component leaves the window.Changelog:
[INTERNAL] [FIXED] - Contain RNTester's iOS tab bar controller before its view enters the window
Test Plan:
Ran:
RNTester builds on this base with the change (2026-11-28, Xcode 27.1):
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug \ -destination 'generic/platform=iOS Simulator' ARCHS=arm64 ONLY_ACTIVE_ARCH=YES CODE_SIGNING_ALLOWED=NO buildNot run: launching it on an iPhone, an iPad and an iPhone Duo (folded, and unfolded in both orientations). The tabs appear and switch on each, and on the physical iPhone Duo with iOS 27.2 repeated unfolded launches no longer come up without tab items. With a breakpoint or log in the tab bar controller's
viewWillAppear:,parentViewControlleris set; onmainit is nil. The missing tab items themselves have only been seen on a physical iPhone Duo with iOS 27.2; the iOS 27.1 simulator keeps the items either way.🤖 Generated with Claude Code