It would be more React-way to use RefObject as approach to get DOM element.
RefObject example
const containmentRef = useRef<HTMLElement>(null); // it will be available after mounting
// it becomes
// { current: null } -> { current: HTMLElement }
<div ref={containmentRef} />
Hi,
It would be more React-way to use RefObject as approach to get DOM element.
RefObject example