#How to inherit generic from a function? F.e. from `forwaredRef()`
10 messages · Page 1 of 1 (latest)
Preview:```ts
import {forwardRef} from "react"
type FR = typeof forwardRef
// ^?```
You can choose specific lines to embed by selecting them before copying the link.
As you see, FR is a type which contains a type of a generic function
However, I cannot use it in types
FR is not generic itself
Is there a way to inherit the generic?
You can use instantiation expressions:
type FR<T, P> = typeof forwardRef<T, P>