Skip to content

Commit 8c6a264

Browse files
Remove need for platform overrides in SafeAreaView.js
Summary: 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 Differential Revision: D47734944 fbshipit-source-id: be406131ae59de53e419c1f86816e5b9975142f2
1 parent 75f4588 commit 8c6a264

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/react-native/Libraries/Components/SafeAreaView/SafeAreaView.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@ let exported: React.AbstractComponent<ViewProps, React.ElementRef<typeof View>>;
2525
* limitation of the screen, such as rounded corners or camera notches (aka
2626
* sensor housing area on iPhone X).
2727
*/
28-
if (Platform.OS === 'android') {
29-
exported = View;
30-
} else {
31-
exported = require('./RCTSafeAreaViewNativeComponent').default;
32-
}
28+
exported = Platform.select({
29+
ios: require('./RCTSafeAreaViewNativeComponent').default,
30+
default: View,
31+
});
3332

3433
export default exported;

0 commit comments

Comments
 (0)