DEV Community

loading...

How to type useRef?

Tom
Lazy developer by day, sleeping by night
・1 min read

This is more for personal reference:

const ref = useRef<HTMLDivElement>(null);

...

<div ref={ref}>
Enter fullscreen mode Exit fullscreen mode

Discussion (0)