Skip to content

fix: View - use React Native's position-aware SafeAreaView for useSafeArea on iOS - #4052

Open
yedidyak wants to merge 1 commit into
masterfrom
fix/View_useSafeArea_iOS
Open

yedidyak wants to merge 1 commit into
masterfrom
fix/View_useSafeArea_iOS

Conversation

@yedidyak

Copy link
Copy Markdown
Collaborator

Description

View with useSafeArea renders react-native-safe-area-context's SafeAreaView whenever that package is installed. That component pads every edge from the nearest SafeAreaProvider's insets regardless of where the view sits, so a header or spacer at the top of a screen gets bottom padding whenever the provider's view extends under a translucent bottom bar. This shows up on iOS 26 with the Liquid Glass tab bar (content is drawn behind the bar, provider bottom inset = tab bar + home indicator): a useSafeArea header grows by the tab bar height and <View useSafeArea/> spacers become visible bands.

On iOS, useSafeArea now renders React Native's SafeAreaView, which UIKit insets only on the edges the view actually touches (a top header gets the status bar, a bottom footer gets the bar, a view in the middle gets nothing). Android and web keep the react-native-safe-area-context SafeAreaView when it is installed, as before. The prop doc describes the behaviour.

No new props. Behaviour difference on iOS: a useSafeArea view that does not touch an edge no longer gets padding for that edge. Explicit edges passed through useSafeArea views on iOS are no longer consumed (React Native's SafeAreaView has no such prop).

Validated with yarn build:dev, yarn lint and yarn test (955 passed).

Changelog

View - on iOS, useSafeArea now insets only the edges the view touches (React Native SafeAreaView), so headers and spacers no longer pick up the bottom inset under translucent tab bars.

Additional info

Needed for iOS 26 Liquid Glass tab bars in Wix apps; consumed by wix-react-native-ui-lib.

…eArea on iOS

react-native-safe-area-context's SafeAreaView pads every edge from the nearest
SafeAreaProvider's insets regardless of where the view sits, so a header with
useSafeArea gets bottom padding whenever the provider extends under a
translucent tab bar (iOS 26 Liquid Glass). React Native's SafeAreaView insets
only the edges the view actually touches, which is what useSafeArea means.
Other platforms keep the safe-area-context SafeAreaView when it is installed.
@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Description Validation Passed

All required sections are properly filled out:

  • ✅ Description
  • ✅ Changelog
  • ✅ Additional info

Your PR is good for review! 🚀


This validation ensures all sections from the PR template are properly filled.

This branch has not been deployed

No deployments
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.

1 participant