MCPcopy Create free account
hub / github.com/callstack/react-native-paper / SafeAreaProviderCompat

Function SafeAreaProviderCompat

src/core/SafeAreaProviderCompat.tsx:38–57  ·  view source on GitHub ↗
({ children, style }: Props)

Source from the content-addressed store, hash-verified

36 : initialWindowMetrics;
37
38export default function SafeAreaProviderCompat({ children, style }: Props) {
39 return (
40 <SafeAreaInsetsContext.Consumer>
41 {(insets) => {
42 if (insets) {
43 // If we already have insets, don't wrap the stack in another safe area provider
44 // This avoids an issue with updates at the cost of potentially incorrect values
45 // https://github.com/react-navigation/react-navigation/issues/174
46 return <View style={[styles.container, style]}>{children}</View>;
47 }
48
49 return (
50 <SafeAreaProvider initialMetrics={initialMetrics} style={style}>
51 {children}
52 </SafeAreaProvider>
53 );
54 }}
55 </SafeAreaInsetsContext.Consumer>
56 );
57}
58
59SafeAreaProviderCompat.initialMetrics = initialMetrics;
60

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…