Answers for "react focus textarea"

0

react focus textarea

const focusDiv = useRef();

useEffect(() => {
 if(focusDiv.current) focusDiv.current.focus(); 
}, [focusDiv]);

return (
  <div ref={focusDiv}></div>
);
Posted by: Guest on October-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language