({ children, style }: Props)
| 36 | : initialWindowMetrics; |
| 37 | |
| 38 | export 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 | |
| 59 | SafeAreaProviderCompat.initialMetrics = initialMetrics; |
| 60 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…