in the docs, it says if you use useRef hooks, it has generic type from react createRef and the default is HTMLSpanElement. however when I do it the callback function way, the parameter has the type of any and it seems like I cannot infer the type to anything including HTMLElement as it doesnt satisfy the Sequence type in <TypeAnimation /> props.
Is there any way I can infer the parameter type from any to any HTMLElement in callback function?
in the docs, it says if you use
useRef
hooks, it has generic type from reactcreateRef
and the default isHTMLSpanElement
. however when I do it the callback function way, the parameter has the type ofany
and it seems like I cannot infer the type to anything includingHTMLElement
as it doesnt satisfy theSequence
type in<TypeAnimation />
props.Is there any way I can infer the parameter type from
any
to anyHTMLElement
in callback function?