title: How to set focus to a div element in a react component using useEffect and useRef hooks? And how to test it?
body: <p>All most all the articles and examples about setting focus are explained using input element. It works well with input element but how to <strong>set focus to a div element</strong> using React useRef and useEffect hooks? </p>
  
  <p>How to test it using <code>toHaveFocus</code> of <em>react-testing-library</em>?</p>