mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-15 10:17:54 +08:00
fix: typing of forwardRef override
This commit is contained in:
@@ -6,11 +6,17 @@ export type StyledComponentProps<P> = StyledProps<P> & {
|
||||
component: React.ComponentType<P>;
|
||||
};
|
||||
|
||||
/**
|
||||
* This might cause issues in the future, but we provide an override of forwardRef
|
||||
* to provide better typing of our components
|
||||
*/
|
||||
declare module "react" {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function forwardRef<T, P = {}>(
|
||||
render: (props: P, ref: React.Ref<T>) => React.ReactElement | null
|
||||
): (props: P & React.RefAttributes<T>) => React.ReactElement | null;
|
||||
): React.ForwardRefExoticComponent<
|
||||
React.PropsWithoutRef<P> & React.RefAttributes<T>
|
||||
>;
|
||||
}
|
||||
|
||||
function StyledComponentFunction<P>(
|
||||
|
||||
Reference in New Issue
Block a user