|
1
|
import { |
|
2
|
PropsWithoutRef, |
|
3
|
ReactNode, |
|
4
|
Ref, |
|
5
|
RefAttributes, |
|
6
|
forwardRef, |
|
7
|
} from "react" |
|
8
|
|
|
9
|
export function genericForwardRef<T, P>( |
|
10
|
render: (props: PropsWithoutRef<P>, ref: Ref<T>) => ReactNode |
|
11
|
): (props: P & RefAttributes<T>) => ReactNode { |
|
12
|
return forwardRef(render) as any |
|
13
|
} |