Closed
Description
I have this type definition file (principle extracted from https://www.nuget.org/packages/material-ui.TypeScript.DefinitelyTyped/):
declare module TestMod {
type TTestStyles = 'x' | 'y' | 'z';
interface TestProps extends React.Props<TestClass> {
myStyle: TTestStyles;
}
interface TestClass extends React.ComponentClass<TestProps> { }
var Test: TestClass;
}
Using this definition in JSX does not work as expected:
var Test: TestMod.TestClass;
var test = <div>
<Test myStyle='yy'/> //Display error as expected (Type '"yy"' is not assignable to type '"x" | "y" | "z")
<TestMod.Test myStyle='yy'/> //Does not display any error
</div>