Explain useRef in functional components.

useRef creates a reference to a DOM element or variable that persists across renders without causing re-renders.

const inputRef = useRef(null);
<input ref={inputRef} />;