okwasniewski / react-native-bottom-tabs

Native Bottom Tabs for React Native
https://okwasniewski.github.io/react-native-bottom-tabs/
MIT License
619 stars 24 forks source link

White screen issue with sidebarAdaptable #130

Closed robertherber closed 1 week ago

robertherber commented 2 weeks ago

We have a whitescreen issue when using react-native-bottom-tabs with sidebarAdaptable enabled. Disabling sidebarAdaptable makes it work as expected. A bit weird since I guess sidebarAdaptable really only makes sense for tablets and bigger screens.

We use the latest version of Expo, expo router, react-native-bottom-tabs and React Native 0.74.

It happens on the following device:

The whitescreen issue was not seen on the following devices:

okwasniewski commented 2 weeks ago

Hey, thanks for opening the issue.

The sidebarAdaptable prop is available only for iOS 18+, so iPad Air 13-inch (simulator, with iOS 17.5) didn't get it.

Can you try it on a device without beta software just to make sure its not something introduced by Apple? I will look into this

robertherber commented 2 weeks ago

Hey, thanks for opening the issue.

The sidebarAdaptable prop is available only for iOS 18+, so iPad Air 13-inch (simulator, with iOS 17.5) didn't get it.

Can you try it on a device without beta software just to make sure its not something introduced by Apple? I will look into this

Thanks for the quick reply! I tested again on iOS 18.1 with the following simulators and got the same white screen behaviour:

okwasniewski commented 2 weeks ago

@robertherber I just checked and I'm unable to reproduce this on iPhone 15 Pro running on iOS 18.1

Can you provide a minimal reproduction code?

okwasniewski commented 2 weeks ago

Oh no I can see the bug!

#if compiler(>=6.0)
        self.tabViewStyle(.sidebarAdaptable)
#endif

You are running Xcode < 16, right?

Can you check if this diff fixes it?

diff --git a/ios/TabViewImpl.swift b/ios/TabViewImpl.swift
index 244999f..8295d99 100644
--- a/ios/TabViewImpl.swift
+++ b/ios/TabViewImpl.swift
@@ -222,6 +222,8 @@ extension View {
       if (enabled) {
 #if compiler(>=6.0)
         self.tabViewStyle(.sidebarAdaptable)
+#else
+        self
 #endif
       } else {
         self
robertherber commented 1 week ago

Oh no I can see the bug!

#if compiler(>=6.0)
        self.tabViewStyle(.sidebarAdaptable)
#endif

You are running Xcode < 16, right?

Can you check if this diff fixes it?

diff --git a/ios/TabViewImpl.swift b/ios/TabViewImpl.swift
index 244999f..8295d99 100644
--- a/ios/TabViewImpl.swift
+++ b/ios/TabViewImpl.swift
@@ -222,6 +222,8 @@ extension View {
       if (enabled) {
 #if compiler(>=6.0)
         self.tabViewStyle(.sidebarAdaptable)
+#else
+        self
 #endif
       } else {
         self

Thanks for looking into it, quite possible this is the case! I'm on XCode 16.1 locally but we're running on Expo Dev Clients, so I guess it depends on what EAS is running.

okwasniewski commented 1 week ago

Can you try with 0.4.0?

https://github.com/okwasniewski/react-native-bottom-tabs/releases/tag/v0.4.0

RevanToma commented 1 week ago

Can you try with 0.4.0?

https://github.com/okwasniewski/react-native-bottom-tabs/releases/tag/v0.4.0

After updating to 0.4.0 and testing it on later iOS versions 18.x+ with the simulators mentioned above , i can confirm its working.

Thnx for the help @okwasniewski 👍