Skip to content

Conversation

@kligarski
Copy link
Contributor

@kligarski kligarski commented May 28, 2025

Description

Fixes #2948

Fixes an issue where system bar styles set using SystemBars.setStyle function from react-native-edge-to-edge would be overridden by default values set in react-native-screens. Those should only work when we define system bar styles via screen options but in #2464 that integrated react-native-edge-to-edge with react-native-screens, we would always set statusBarTranslucent and navigationBarTranslucent props when in edge to edge (code here), which would set didSetStatusBarAppearance/didSetNavigationBarAppearance and in result, make screens use default values for system bar styles.

Setting statusBarTranslucent and navigationBarTranslucent props to true in edge-to-edge is not necessary and it's currently ignored in native code when in edge-to-edge after #2913 (here and there).

Thanks to @efstathiosntonas for reporting the issue and finding the culprit!

Changes

  • remove setting statusBarTranslucent and navigationBarTranslucent in edge-to-edge.tsx
  • add test screen

Screenshots / GIFs

before after
before_2949.mp4
after_2949.mp4

Test code and steps to reproduce

Run Test2949 as a main app by modifying App.tsx in example app.

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@efstathiosntonas
Copy link

thank you @kligarski for fixing this so fast ❤️

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's proceed here.

@kligarski kligarski merged commit fe80756 into main May 28, 2025
5 checks passed
@kligarski kligarski deleted the @kligarski/fix-system-bar-styles-react-native-edge-to-edge branch May 28, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using SystemBars seems to be overridden by rn-screens

4 participants