TypeScript/tests/cases/compiler/tsxInvokeComponentType.tsx
Wesley Wigham 972c403cd8
JSX uses mixed signatures and union sigs use subtype on partial match (#28141)
* JSX uses mixed signatures and union sigs use subtype on partial match

* Small improvement
2018-10-26 16:01:32 -07:00

15 lines
370 B
TypeScript

// @jsx: react
// @strict: true
// @esModuleInterop: true
/// <reference path="/.lib/react16.d.ts" />
import React, { ComponentType } from "react";
declare const Elem: ComponentType<{ someKey: string }>;
const bad = <Elem />;
const good = <Elem someKey="ok" />;
declare const Elem2: ComponentType<{ opt?: number }>;
const alsoOk = <Elem2>text</Elem2>;