How can I declare/ignore a missing JSX type?

jsx, typescript

Solution

If you want to ignore an error inline, use this weird syntax:

{/* 
// @ts-ignore */}
<Foo id="fooDoesNotHaveIdType" /> 

Taken from https://github.com/Microsoft/TypeScript/issues/27552

Problem

I would like to use the SVG `use` element in a `.tsx` file: ``` <mask id="mask1"> <use ... /> </mask> ``` I'm transpiling this to React calls directly. However, I keep receiving the following error: Property 'use' does not exist on type 'JSX.IntrinsicElements'. I believe this element is missing from the standard lib definitions. How can I declare this type for the TypeScript compiler to see, similar to how I can declare a class or variable? The usual `declare var` and `declare class` statements have no effect. If that's not possible, how can I make the TypeScript compiler ignore this error?

Original source