How to use a TypeScript cast with JSX/TSX
<p>When casting in a <code>.tsx</code> file, the compiler assumes it to be JSX, e.g.:</p>

<pre><code>(&lt;HtmlInputElement&gt; event.target).value
</code></pre>

<p>gives an error</p>

<blockquote>
  <p>JSX element type 'HtmlInputElement' is not a constructor function for JSX elements</p>
</blockquote>

<p>How do you cast TypeScript in a <code>.tsx</code> file?</p>