Skip to content

Commit b753357

Browse files
authored
Fix render condition for SafeAreaSpacerView (#1563)
1 parent 4ac8033 commit b753357

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/components/SafeArea/SafeAreaSpacerView.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import React from 'react';
2-
import {View, requireNativeComponent, ViewStyle} from 'react-native';
2+
import {View, requireNativeComponent, ViewStyle, Platform} from 'react-native';
33

44
const NativeSafeAreaSpacerView = requireNativeComponent('SafeAreaSpacerView');
5+
const isIOS = Platform.OS === 'ios';
56

67
export type SafeAreaSpacerViewProps = {
7-
style?: ViewStyle
8-
}
8+
style?: ViewStyle;
9+
};
910

1011
const SafeAreaSpacerView = ({style}: SafeAreaSpacerViewProps) => {
1112
return (
1213
// @ts-ignore
13-
NativeSafeAreaSpacerView ? <NativeSafeAreaSpacerView style={style}/> : <View style={style}/>
14+
isIOS ? <NativeSafeAreaSpacerView style={style}/> : <View style={style}/>
1415
);
1516
};
1617

0 commit comments

Comments
 (0)