forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckJsxChildrenProperty16.types
123 lines (105 loc) · 4.18 KB
/
checkJsxChildrenProperty16.types
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//// [tests/cases/conformance/jsx/checkJsxChildrenProperty16.tsx] ////
=== Performance Stats ===
Assignability cache: 2,500
Type Count: 10,000
Instantiation count: 50,000
Symbol count: 50,000
=== checkJsxChildrenProperty16.tsx ===
/// <reference path="react16.d.ts" />
// repro from #53493
import React = require('react');
>React : typeof React
> : ^^^^^^^^^^^^
export type Props =
>Props : Props
> : ^^^^^
| { renderNumber?: false; children: (arg: string) => void }
>renderNumber : false | undefined
> : ^^^^^^^^^^^^^^^^^
>false : false
> : ^^^^^
>children : (arg: string) => void
> : ^ ^^ ^^^^^
>arg : string
> : ^^^^^^
| {
renderNumber: true;
>renderNumber : true
> : ^^^^
>true : true
> : ^^^^
children: (arg: number) => void;
>children : (arg: number) => void
> : ^ ^^ ^^^^^
>arg : number
> : ^^^^^^
};
export declare function Foo(props: Props): JSX.Element;
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
>props : Props
> : ^^^^^
>JSX : any
> : ^^^
export const Test = () => {
>Test : () => JSX.Element
> : ^^^^^^^^^^^^^^^^^
>() => { return ( <> <Foo>{(value) => {}}</Foo> <Foo renderNumber>{(value) => {}}</Foo> <Foo children={(value) => {}} /> <Foo renderNumber children={(value) => {}} /> </> );} : () => JSX.Element
> : ^^^^^^^^^^^^^^^^^
return (
>( <> <Foo>{(value) => {}}</Foo> <Foo renderNumber>{(value) => {}}</Foo> <Foo children={(value) => {}} /> <Foo renderNumber children={(value) => {}} /> </> ) : JSX.Element
> : ^^^^^^^^^^^
<>
><> <Foo>{(value) => {}}</Foo> <Foo renderNumber>{(value) => {}}</Foo> <Foo children={(value) => {}} /> <Foo renderNumber children={(value) => {}} /> </> : JSX.Element
> : ^^^^^^^^^^^
<Foo>{(value) => {}}</Foo>
><Foo>{(value) => {}}</Foo> : JSX.Element
> : ^^^^^^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
>(value) => {} : (value: string) => void
> : ^ ^^^^^^^^^^^^^^^^^
>value : string
> : ^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
<Foo renderNumber>{(value) => {}}</Foo>
><Foo renderNumber>{(value) => {}}</Foo> : JSX.Element
> : ^^^^^^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
>renderNumber : true
> : ^^^^
>(value) => {} : (value: number) => void
> : ^ ^^^^^^^^^^^^^^^^^
>value : number
> : ^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
<Foo children={(value) => {}} />
><Foo children={(value) => {}} /> : JSX.Element
> : ^^^^^^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
>children : (value: string) => void
> : ^ ^^^^^^^^^^^^^^^^^
>(value) => {} : (value: string) => void
> : ^ ^^^^^^^^^^^^^^^^^
>value : string
> : ^^^^^^
<Foo renderNumber children={(value) => {}} />
><Foo renderNumber children={(value) => {}} /> : JSX.Element
> : ^^^^^^^^^^^
>Foo : (props: Props) => JSX.Element
> : ^ ^^ ^^^^^
>renderNumber : true
> : ^^^^
>children : (value: number) => void
> : ^ ^^^^^^^^^^^^^^^^^
>(value) => {} : (value: number) => void
> : ^ ^^^^^^^^^^^^^^^^^
>value : number
> : ^^^^^^
</>
);
};