fix(TabView): respect user-supplied tabBarHidden#524
Draft
spokodev wants to merge 1 commit into
Draft
Conversation
The native side wired tabBarHidden into the SwiftUI tab bar via callstack#76, but the JS wrapper hardcoded tabBarHidden={!!renderCustomTabBar} after the {...props} spread, so any value the caller passed was overwritten before it reached NativeTabView. The prop was also absent from the TabView Props interface so it never type-checked at all. Add tabBarHidden to Props, destructure it explicitly, and keep the renderCustomTabBar default only as a fallback when the caller does not supply a value. Closes callstack#521
thiagobrez
reviewed
Jun 8, 2026
| labeled = Platform.OS !== 'android' ? true : undefined, | ||
| getFreezeOnBlur = ({ route }: { route: Route }) => route.freezeOnBlur, | ||
| tabBar: renderCustomTabBar, | ||
| tabBarHidden, |
Collaborator
There was a problem hiding this comment.
Please add the default false value 🙏🏻
Suggested change
| tabBarHidden, | |
| tabBarHidden = false, |
thiagobrez
reviewed
Jun 8, 2026
Comment on lines
+215
to
+221
| /** | ||
| * Whether to hide the native tab bar. Defaults to `true` when a custom | ||
| * `tabBar` is provided (so the native bar does not stack on top of the | ||
| * custom one), otherwise `false`. Set explicitly to override the default, | ||
| * which is required on iOS 26+ where `UITabBar.isHidden` workarounds from | ||
| * outside React Native no longer reach the SwiftUI-backed tab bar. | ||
| */ |
Collaborator
There was a problem hiding this comment.
No need for such a big wall of text, let's keep it simple
Suggested change
| /** | |
| * Whether to hide the native tab bar. Defaults to `true` when a custom | |
| * `tabBar` is provided (so the native bar does not stack on top of the | |
| * custom one), otherwise `false`. Set explicitly to override the default, | |
| * which is required on iOS 26+ where `UITabBar.isHidden` workarounds from | |
| * outside React Native no longer reach the SwiftUI-backed tab bar. | |
| */ | |
| /** | |
| * Whether to hide the native tab bar. | |
| */ |
thiagobrez
reviewed
Jun 8, 2026
| 'react-native-bottom-tabs': patch | ||
| --- | ||
|
|
||
| Respect user-supplied `tabBarHidden` on `TabView`. The prop was wired natively but the JS wrapper hardcoded `tabBarHidden={!!renderCustomTabBar}` after the `{...props}` spread, so any user value was silently overwritten. The prop is now declared on the public `TabView` API and only falls back to the custom-tab-bar default when the caller omits it, which lets iOS 26+ users hide the SwiftUI-backed tab bar from JS again. |
Collaborator
There was a problem hiding this comment.
Same here, we don't need the whole explanation on the changelogs
Suggested change
| Respect user-supplied `tabBarHidden` on `TabView`. The prop was wired natively but the JS wrapper hardcoded `tabBarHidden={!!renderCustomTabBar}` after the `{...props}` spread, so any user value was silently overwritten. The prop is now declared on the public `TabView` API and only falls back to the custom-tab-bar default when the caller omits it, which lets iOS 26+ users hide the SwiftUI-backed tab bar from JS again. | |
| Respect user-supplied `tabBarHidden` on `TabView`. |
Collaborator
|
Thanks @spokodev! Left some easy comments. If you can fix them and mark the PR as ready, we can merge soon! |
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.
Closes #521.
tabBarHiddenis wired natively (SwiftUI.hideTabBar(props.tabBarHidden), landed in #76) but the JS wrapper inpackages/react-native-bottom-tabs/src/TabView.tsxhardcodedtabBarHidden={!!renderCustomTabBar}after the{...props}spread, so any caller-supplied value was overwritten before it reachedNativeTabView. The prop was also absent from theProps<Route>interface so it never surfaced at the type level either.This PR:
tabBarHidden?: booleanto theTabViewProps<Route>interface with a JSDoc note that explains the default and the iOS 26+ use case from the issue!!renderCustomTabBarbehavior as the fallback when the caller does not pass a value (tabBarHidden ?? !!renderCustomTabBar)Effect:
<TabView ... tabBarHidden={true} />to hide the native bar without rendering a customtabBar, which is what the issue needs on iOS 26 where theUITabBar.isHiddenworkarounds from outside React Native no longer reach the SwiftUI-backed bartabBarHiddenget the same behavior as before (hidden ifftabBaris provided)Verification:
tsc -bclean on the packageeslint packages/react-native-bottom-tabs/src/TabView.tsxreports only the pre-existingno-shadowwarning onloaded(line 293), unrelated to this changeit.todo('write a test')andyarn testfails onmaindue to Flow type syntax inreact-native/jest/setup.js, so a behavioural test would require fixing the jest config first which is outside the scope of this PR.changeset/respect-user-tab-bar-hidden.md(react-native-bottom-tabs: patch)Out of scope:
@bottom-tabs/react-navigation) does not referencetabBarHidden, so the<Tabs.Navigator tabBarHidden={shouldHide}>mention in the issue would need a separate change in that package's screen-options forwarding