File: reactSFCAndFunctionResolvable.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (69 lines) | stat: -rw-r--r-- 2,045 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
=== tests/cases/compiler/reactSFCAndFunctionResolvable.tsx ===
/// <reference path="react16.d.ts" />

import * as React from 'react';
>React : typeof React

declare const Radio: (props: {}) => React.ReactElement<{}>;
>Radio : (props: {}) => React.ReactElement<{}>
>props : {}
>React : any

declare const OtherRadio: () => React.ReactElement<{}>;
>OtherRadio : () => React.ReactElement<{}>
>React : any

declare const Checkbox: React.SFC;
>Checkbox : React.SFC<{}>
>React : any

declare const condition1: boolean;
>condition1 : boolean

declare const condition2: boolean;
>condition2 : boolean

declare const condition3: boolean;
>condition3 : boolean

const RandomComponent: React.SFC = () => {
>RandomComponent : React.SFC<{}>
>React : any
>() => {  const Component =    condition1      ? Radio      : Checkbox;  const OtherComponent =    condition2      ? OtherRadio      : Checkbox;  return condition1 ? <Component /> : <OtherComponent />;} : () => JSX.Element

  const Component =
>Component : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}>

    condition1
>condition1      ? Radio      : Checkbox : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}>
>condition1 : boolean

      ? Radio
>Radio : (props: {}) => React.ReactElement<{}>

      : Checkbox;
>Checkbox : React.SFC<{}>

  const OtherComponent =
>OtherComponent : (() => React.ReactElement<{}>) | React.SFC<{}>

    condition2
>condition2      ? OtherRadio      : Checkbox : (() => React.ReactElement<{}>) | React.SFC<{}>
>condition2 : boolean

      ? OtherRadio
>OtherRadio : () => React.ReactElement<{}>

      : Checkbox;
>Checkbox : React.SFC<{}>

  return condition1 ? <Component /> : <OtherComponent />;
>condition1 ? <Component /> : <OtherComponent /> : JSX.Element
>condition1 : boolean
><Component /> : JSX.Element
>Component : ((props: {}) => React.ReactElement<{}>) | React.SFC<{}>
><OtherComponent /> : JSX.Element
>OtherComponent : (() => React.ReactElement<{}>) | React.SFC<{}>

};