TypeScript/tests/cases/compiler/jsxElementClassTooManyParams.tsx
Wesley Wigham 17554ff285
Fix JSX contextual types to not eagerly become apparent, use 2-pass inference for JSX (#21383)
* Fix JSX contextual types to not eagerly become apparent

* Apply changes from code review, unify common code

* Fix jsx children contextual typing

* Light code review feedback

* Use fillMissingTypeArguments

* Accept nonliteral jsx child type

* Add test for the fillMissingTypeArguments case
2018-02-05 16:33:39 -08:00

18 lines
659 B
TypeScript

// @strict: true
// @jsx: preserve
namespace JSX {
export interface Element {}
export interface IntrinsicClassAttributes<TClass, TOther=never> {
ref?: TClass;
item?: TOther;
}
export interface ElementClass extends Element {}
export interface ElementAttributesProperty { props: {}; }
export interface ElementChildrenAttribute { children: {}; }
export interface IntrinsicAttributes {}
export interface IntrinsicElements { [key: string]: Element }
}
class ElemClass<T extends {x: number}> implements JSX.ElementClass {
constructor(public props: T) {}
}
const elem = <ElemClass x={12} y={24} />