question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v6 hiding tabbar with {display:none} does not work on iOS

See original GitHub issue

Current behavior

(I am opening this issue here because it is said that this issue might be related to this library I have already opened the issue in the react-navigation repo)

I am trying to achieve dynamically hiding tab bar behavior. I already know what documentation suggest for this purpose.

However, I am not a big fan of restructuring whole navigators and routes for only hiding tab bar. Thus, I did prefer a more dynamic way. But, I am facing a problem with IOS simulator/real device. It works fine on android devices.

What I do is basically, (just a summary of the logic I do app

  <BottomTabBar
    style={{ display: shouldRenderTabBar ? "flex" : "none" }}
    {...props}
  />;

And this is what happens on ios simulator/real-device. Video link

Seems like display:none doesn’t affect anyway to height of bottom tab bar. I am wondering while it works on android emulator/real-device what’s wrong with IOS?

Expected behavior

Hide bottom tab bar with the applied styling

Reproduction

https://snack.expo.dev/@tarikfp/hide-bottom-bar-fails-on-ios

https://user-images.githubusercontent.com/61876765/159287071-b9b4cf09-9998-414d-9ded-bb25b2ae76e0.mov

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

Environment

  • [] I’ve removed the packages that I don’t use
package version
@react-navigation/native 6.0.6
@react-navigation/bottom-tabs 6.1.0
@react-navigation/native-stack 6.2.5
react-native-safe-area-context 3.3.2
react-native-screens 3.9.0
react-native-gesture-handler 1.10.3
react-native 0.66.3

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tarikpnrcommented, Mar 22, 2022

@hirbod Yes, I use native-stack as well. Some says that it might also be related to react-native version. In expo snack you wont see this error.

I really would like to have a prop for tabBarVisible as it used to be before… But apparently, it seems not possible from what I can see.

0reactions
wibb36commented, Apr 7, 2022

exactly, a prop more like tabBarHide is a must. does anyone know how tabBarHideOnKeyboard works?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Repro provided]React Navigation v6 hiding tabbar with ...
... Navigation v6 hiding tabbar with {display:none} does not work on iOS ... I am trying to achieve dynamically hiding tab bar behavior....
Read more >
How to hide Tab Bar from the screen in React Navigation 6
In this tutorial, we'll show how to hide Tab bar from the screen in React ... in here if you try to show/hide...
Read more >
Hiding tab bar in specific screens
After re-organizing the navigation structure, now if we navigate to the Profile or Settings screens, the tab bar won't be visible over the...
Read more >
Hide bottom tab bar on a specific screen in React ...
It doesn't show up on the Product and Contact screens. Here's how our app works: The Code. Your App.js and add the ...
Read more >
React Navigation 6: Hiding bottom tab on a specific screen
The Code · 1. Adding the required libraries to our project: · 2. To make the bottom tab bar more attractive and meaningful,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found