1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
//// [tests/cases/compiler/expandoFunctionContextualTypes.ts] ////
//// [expandoFunctionContextualTypes.ts]
interface MyComponentProps {
color: "red" | "blue"
}
interface StatelessComponent<P> {
(): any;
defaultProps?: Partial<P>;
}
const MyComponent: StatelessComponent<MyComponentProps> = () => null as any;
MyComponent.defaultProps = {
color: "red"
};
//// [expandoFunctionContextualTypes.js]
var MyComponent = function () { return null; };
MyComponent.defaultProps = {
color: "red"
};
|