diff --git a/src/react-native-safe-area-context.js b/src/react-native-safe-area-context.js new file mode 100644 index 00000000000..a967c2139ab --- /dev/null +++ b/src/react-native-safe-area-context.js @@ -0,0 +1,23 @@ +/* @flow strict-local */ +import type { ComponentType, ElementConfig } from 'react'; +import { + withSafeAreaInsets as withSafeAreaInsetsInner, + type EdgeInsets, +} from 'react-native-safe-area-context'; + +import type { BoundedDiff } from './generics'; + +/* eslint-disable flowtype/generic-spacing */ + +/** + * Exactly like `withSafeAreaInsets` upstream, but properly typed. + * + * The correction is made here, instead of in the libdef, so that we + * can use the handy `BoundedDiff` type, as we do in our type-wrapper + * for react-redux's `connect`. + */ +export function withSafeAreaInsets
>(
+ WrappedComponent: C,
+): ComponentType<$ReadOnly