These are the restraints for what T
you can pass to an ElementRef
, from the React typings:
T extends
| ForwardRefExoticComponent<any>
| { new (props: any): Component<any> }
| ((props: any, context?: any) => ReactElement | null)
| keyof JSX.IntrinsicElements
It can be any ComponentType
(FunctionComponent
or ClassComponent
), a built-in DOM element like div
, and some other complicated things.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…