You can point a ref to any value. However, the most common use case for a ref is to access a DOM element.
For example, this is handy if you want to focus an input programmatically. When you pass a ref to a ref attribute in JSX, like <div ref={myRef}>, React will put the corresponding DOM element into myRef.current. Once the element is removed from the DOM, React will update myRef.current to be null.
Managing focus, text selection, or media playback.
Triggering imperative animations.
Integrating with third-party DOM libraries.