react-native-safe-area-context
Version:
A flexible way to handle safe area, also works on Android and web.
17 lines (13 loc) • 494 B
text/typescript
import { UIManager } from 'react-native';
import { Metrics } from './SafeArea.types';
const RNCSafeAreaProviderConfig = UIManager.getViewManagerConfig(
'RNCSafeAreaProvider',
) as any;
export const initialWindowMetrics = (RNCSafeAreaProviderConfig != null &&
RNCSafeAreaProviderConfig.Constants != null
? RNCSafeAreaProviderConfig.Constants.initialWindowMetrics
: null) as Metrics | null;
/**
* @deprecated
*/
export const initialWindowSafeAreaInsets = initialWindowMetrics?.insets;