Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Status Bar Error #2083

Open
AlirezaHadjar opened this issue Mar 26, 2024 · 8 comments · May be fixed by #2106
Open

iOS Status Bar Error #2083

AlirezaHadjar opened this issue Mar 26, 2024 · 8 comments · May be fixed by #2106
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@AlirezaHadjar
Copy link

Description

When I upgraded my personal project to use the new Screen Transition API, I noticed an error when booting the app.
Screenshot 2024-03-26 at 7 51 34 PM

Steps to reproduce

  1. Initialized a repo using npx react-native@latest init RNSSwipeAnimationBug
  2. Installed these dependencies
    "@react-navigation/native": "^6.1.17",
    "react-native-gesture-handler": "^2.15.0",
    "react-native-reanimated": "^3.9.0-nightly-20240325-9e79766a4",
    "react-native-safe-area-context": "^4.9.0",
    "react-native-screens": "^3.30.1"
  1. Ran yarn ios
  2. Copied the SwipeBackAnimation.tsx from the Examples folder and pasted it in my repo
  3. Faced the error!

Snack or a link to a repository

https://github.com/AlirezaHadjar/RNSSwipeAnimationBug

Screens version

3.30.1

React Native version

0.73.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 15 Pro

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided Platform: iOS This issue is specific to iOS labels Mar 26, 2024
@AlirezaHadjar
Copy link
Author

Side note:
Setting UIViewControllerBasedStatusBarAppearance to true fixes the issue. But I'm not sure this is the correct way of fixing this since some libraries such as react-native-bars require setting UIViewControllerBasedStatusBarAppearance to false
Screenshot 2024-03-26 at 8 10 51 PM

@tboba
Copy link
Member

tboba commented Mar 26, 2024

Hi, @AlirezaHadjar, thanks for submitting the issue! Yeah, this is definitely not correct to require configuring this prop while using Screen Transition API 😅 We'll look onto that, thanks!

@friedolinfoerder
Copy link

Hi, @AlirezaHadjar and @tboba, I see the issue for version 2.21.0 upwards. With version 2.20.0 the issue doesn't show up.

React Native version 0.71.14
Platforms iOS
JavaScript runtime Hermes
Workflow React Native (without Expo)
Architecture Paper (Old Architecture)
Build type Debug mode
Device iOS simulator
Device model iPhone 14

@tboba
Copy link
Member

tboba commented Apr 15, 2024

I've investigated this PR quite a bit and I see that this error is caused by this line - https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/views/NativeStackView.tsx#L310
Since we want to also rely on theme from React Navigation, we're depending on the value returned from ThemeContext. This is wrong approach, since on native side we're checking if this value has been set - if so, we're throwing an error if UIViewControllerBasedStatusBarAppearance is set to <false />. We've got some idea how can we fix that error, but the solution is not ready yet.

@tboba tboba linked a pull request Apr 18, 2024 that will close this issue
3 tasks
@Bayramito
Copy link

any progress on this one ? I just got the issue once i imported the createNativeStackNavigator from react-native-screens

@tboba
Copy link
Member

tboba commented May 6, 2024

Hi @Bayramito, currently the PR with the fix is open, however since it's a breaking change, we're waiting for merging it. For now, if you're not using any lacking API from native-stack v5, I'd recommend to migrate to native-stack v6! See Migrating from 5.x for more details.

@ChronoByteCosmonaut
Copy link

This is still an issue!!!

@blytung
Copy link

blytung commented Sep 4, 2024

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants