Skip to content

Commit

Permalink
Remove need for platform overrides in SafeAreaView.js (#38601)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38601

This file is forked in out of tree platforms as:

- macOS > https://github.com/microsoft/react-native-macos/blob/main/Libraries/Components/SafeAreaView/SafeAreaView.js#L28-L33
- Windows > https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Components/SafeAreaView/SafeAreaView.windows.js#L30-L36

The change here removes the need of forking this file

Changelog:
[General] [Fixed] - [SafeAreaView] Remove need for platform overrides in SafeAreaView.js

Reviewed By: NickGerleman

Differential Revision: D47734944

fbshipit-source-id: 84249a3b3e7e3807b3d5ee4bfa4b1cb140541b8b
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Jul 25, 2023
1 parent 5cf66bd commit 80f531f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;
* limitation of the screen, such as rounded corners or camera notches (aka
* sensor housing area on iPhone X).
*/
if (Platform.OS === 'android') {
exported = View;
} else {
exported = require('./RCTSafeAreaViewNativeComponent').default;
}
exported = Platform.select({
ios: require('./RCTSafeAreaViewNativeComponent').default,
default: View,
});

export default exported;

0 comments on commit 80f531f

Please sign in to comment.