Manipulating the DOM with refs in code
const inputRef = useRef<HTMLInputElement>(null);
<button onClick={() => inputRef.current?.focus()}>Focus</button>;Read the example from data and control flow to the resulting UI. Keep the component boundary small.