Attach the ref object to an element's ref attribute. After React assigns the DOM node to ref.current, an event handler or Effect can call its focus() method.