From a2467c5b24e23a719b1a19ba9d88e59dab831c7b Mon Sep 17 00:00:00 2001 From: "Aironas K." <53496062+akuul@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:22:03 +0300 Subject: [PATCH] fix: ts error due to react types forwardRef changes (#528) Co-authored-by: Aironas Kulvelis --- src/SafeAreaContext.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SafeAreaContext.tsx b/src/SafeAreaContext.tsx index 5da007e3..87ad0553 100644 --- a/src/SafeAreaContext.tsx +++ b/src/SafeAreaContext.tsx @@ -141,11 +141,13 @@ export type WithSafeAreaInsetsProps = { }; export function withSafeAreaInsets( - WrappedComponent: React.ComponentType, + WrappedComponent: React.ComponentType< + (React.PropsWithoutRef | T) & WithSafeAreaInsetsProps + >, ): React.ForwardRefExoticComponent< React.PropsWithoutRef & React.RefAttributes > { - return React.forwardRef((props: T, ref: React.Ref) => { + return React.forwardRef((props, ref) => { const insets = useSafeAreaInsets(); return ; });