TypeScript/tests/cases/compiler/reactSFCAndFunctionResolvable.tsx
Wesley Wigham 96937fd592
Allow union signatures to merge when they have differing argument counts (#28604)
* Allow union signatures to merge when they have differing argument counts

* Accept updated baselines

* Adjust comments io changed tests
2018-11-19 17:05:28 -08:00

26 lines
625 B
TypeScript

// @jsx: react
/// <reference path="/.lib/react16.d.ts" />
import * as React from 'react';
declare const Radio: (props: {}) => React.ReactElement<{}>;
declare const OtherRadio: () => React.ReactElement<{}>;
declare const Checkbox: React.SFC;
declare const condition1: boolean;
declare const condition2: boolean;
declare const condition3: boolean;
const RandomComponent: React.SFC = () => {
const Component =
condition1
? Radio
: Checkbox;
const OtherComponent =
condition2
? OtherRadio
: Checkbox;
return condition1 ? <Component /> : <OtherComponent />;
};