generated at
useRef
Ref objectを返す


あるあるの型付
ts
const ref = useRef<HTMLElement>(null);
HTMLElementか、要素ごとに具体化した型を付ける
ElementRefが便利なのらしい
>@mattpocockuk: ElementRef is super nice.
>Here's how it can make typing useRef easier in React 🧵
>



参考
>useRef() is basically useState({current: initialValue })[0]