Skip to content

Commit 80f531f

Browse files
Remove need for platform overrides in SafeAreaView.js (#38601)
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
1 parent 5cf66bd commit 80f531f

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)