title: How to use React useRef hook with typescript?
body: <p>I am creating a reference using the new useRef hook</p>
  <p><code>const anchorEl = React.useRef&lt;HTMLDivElement&gt;(null)</code></p>
  <p>And using like</p>
  <pre><code>&lt;div style={{ width: &quot;15%&quot;, ...flexer, justifyContent: &quot;flex-end&quot; }}&gt;
      &lt;Popover
          id=&quot;simple-popper&quot;
          open={open}
          anchorEl={anchorEl}
          onClose={() =&gt; {
            setOpen(false)
          }}
          anchorOrigin={{
            vertical: 'bottom',
            horizontal: 'center',
          }}
          transformOrigin={{
            vertical: 'top',
            horizontal: 'center',
          }}
      &gt;
          &lt;Typography&gt;The content of the Popover.&lt;/Typography&gt;
      &lt;/Popover&gt;
  &lt;/div&gt;
  &lt;div ref={anchorEl} &gt;
        ...
  </code></pre>
  <p>but I get this error</p>
  <pre><code>TS2322: Type 'MutableRefObject&lt;HTMLDivElement&gt;' is not assignable to type 'HTMLElement | ((element: HTMLElement) =&gt; HTMLElement)'.
    Type 'MutableRefObject&lt;HTMLDivElement&gt;' is not assignable to type '(element: HTMLElement) =&gt; HTMLElement'.
      Type 'MutableRefObject&lt;HTMLDivElement&gt;' provides no match for the signature '(element: HTMLElement): HTMLElement'.
  Version: typescript 3.2.2, tslint 5.12.0
  </code></pre>