We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f99cb14 commit a2467c5Copy full SHA for a2467c5
src/SafeAreaContext.tsx
@@ -141,11 +141,13 @@ export type WithSafeAreaInsetsProps = {
141
};
142
143
export function withSafeAreaInsets<T>(
144
- WrappedComponent: React.ComponentType<T & WithSafeAreaInsetsProps>,
+ WrappedComponent: React.ComponentType<
145
+ (React.PropsWithoutRef<T> | T) & WithSafeAreaInsetsProps
146
+ >,
147
): React.ForwardRefExoticComponent<
148
React.PropsWithoutRef<T> & React.RefAttributes<unknown>
149
> {
- return React.forwardRef((props: T, ref: React.Ref<unknown>) => {
150
+ return React.forwardRef<unknown, T>((props, ref) => {
151
const insets = useSafeAreaInsets();
152
return <WrappedComponent {...props} insets={insets} ref={ref} />;
153
});
0 commit comments