Closed
Description
TypeScript Version: 3.0.1
Search Terms: TSX, generics, required, jsx, typescript
I also read the jsx section in documentation.
Code
.tsx
import * as React from "react";
class Generics<T> extends React.Component {
render() {
return <span>Generics is rendered even though it's T is not defined</span>;
}
}
export default () => (
<h1>
This should fail as Generics does not have a default type. <Generics />
</h1>
);
Expected behavior:
The above code should fail during compilation.
Actual behavior:
The above code passes the compilation, even though the generic type is not provided and not defaulted
Playground Link:
https://codesandbox.io/s/4q15l927x
Related Issues:
#3960