Conversation
8e1f4ce to
136bc6d
Compare
|
Switching to multi-root is a pretty big change, and we should probably discuss the consequences a bit more. Can we do something similar to react-native-screens and keep everything in a single root? |
|
@javache We can, but while depending on Unless we patch or depend on at least a suitable SafeAreaView in core, this is a pragmatic way to opt out of solving these concerns, IMO. |
|
Yeah, not suggesting we adopt |
+1 to this. I also don't think we should optimize RNTester for iPhone Duo. We haven't optimized it for Android Foldable devices either. We run e2e tests on this app so the simpler it is to maintain, the better. |
|
I think I'll be able to push an update that keeps the single root design from the JS point of view 👍🏻 Due next week. @cortinico Disagree. It's reasonable to make our tester app usable, and before this diff we already had UX bugs on regular iPhones. It's also not, theoretically, out of scope for core to implement some incoming foldable APIs/behaviours, so it's nice to at least view RNTester on a foldable without blatant safe area bugs. (Aware we will probably try to add these APIs via other libraries, but it's not fundamentally off the table.) If we support iOS, it's worth having a trivial navigation setup for our iOS tester app — especially if it saves maintaining custom UI code. |
136bc6d to
d3ba4d3
Compare
|
@javache Diff updated. This is the minimum "make it not buggy" fix — and ends up a little sadder, unfortunately:
Attempting to build a JS-controlled version with the advantages of the former is a mess sadly: produces more code than V1, and doesn't fix a pop-to-root glitch (pre-existing but worsened). |
d3ba4d3 to
e32d0d4
Compare
e32d0d4 to
64c3cd2
Compare


Summary:
Moves RNTester's tab bar on iOS to a native
UITabBarController, hosted by a<RNTesterTabsIOS>component within the single React Native root — allowing us to leverage the platform tab bar and safe area behaviours needed to support iPhone Duo.Android is unchanged. No new capabilities are added to React Native itself.
Motivation
RNTester on iOS runs as one React Native surface that draws its own header and bottom tab bar in JS, so it cannot follow platform layouts such as iPhone Duo's, where the status bar sits in a side cutout and the tab bar moves to the side.
Necessary and intentional fork: Host the iOS tab bar natively in an app-local Fabric component, which gives RNTester the platform tab bar and minimally supports iPhone Duo, while the app stays a single React Native root.
<SafeAreaView>in core at this stage, or making any hardcoded hacks to the custom tab bar — which had already drifted into buggy territory on the regular iPhone.react-native-screens, to avoid introducing a dependency within core (againstmain).Changes
<RNTesterTabsIOS>, an app-local Fabric component wrapping aUITabBarControllerwith Components, APIs and Playground; the React content moves into the selected tab and is kept within the safe area.RNTesterNavigationReducer, shared with Android: native reports tab presses and the insets content should clear.The header stays in JS, so there is no native back button or back swipe. A native header needs a view controller per navigation level, which is left out of scope.
Notes
Out-of-tree platforms: RNTester stays a single React Native surface.
<RNTesterTabsIOS>renders only on iOS, so other platforms keep the JS header and tab bar.Changelog: [Internal]
Test Plan:
xcodebuild -workspace packages/rn-tester/RNTesterPods.xcworkspace -scheme RNTester -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 18 Pro' buildapis-tabtest ID the Maestro flow uses; modules and examples push with native back and the docs button; Recently Viewed updates on the list.rntester://example/Switch) and at cold launch (rntester://example/Image).V1 screenshots (outdated)