diff --git a/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt new file mode 100644 index 00000000000..ecae349e19e --- /dev/null +++ b/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt @@ -0,0 +1,56 @@ +tests/cases/conformance/jsx/file.tsx(42,27): error TS2322: Type '{ a: 10; b: "hi"; children: Element[]; }' is not assignable to type 'IntrinsicAttributes & SingleChildProp'. + Type '{ a: 10; b: "hi"; children: Element[]; }' is not assignable to type 'SingleChildProp'. + Types of property 'children' are incompatible. + Type 'Element[]' is not assignable to type 'Element'. + Property 'type' is missing in type 'Element[]'. + + +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== + import React = require('react'); + + interface Prop { + a: number, + b: string, + children: JSX.Element | JSX.Element[]; + } + + class Button extends React.Component { + render() { + return (
My Button
) + } + } + + function AnotherButton(p: any) { + return

Just Another Button

; + } + + function Comp(p: Prop) { + return
{p.b}
; + } + + // OK + let k1 = <>