forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsxIntrinsicUnions.types
More file actions
49 lines (43 loc) · 1.13 KB
/
jsxIntrinsicUnions.types
File metadata and controls
49 lines (43 loc) · 1.13 KB
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
//// [tests/cases/compiler/jsxIntrinsicUnions.tsx] ////
=== Performance Stats ===
Assignability cache: 2,500
Type Count: 10,000
Instantiation count: 50,000
Symbol count: 50,000
=== jsxIntrinsicUnions.tsx ===
/// <reference path="react16.d.ts" />
import * as React from "react";
>React : typeof React
> : ^^^^^^^^^^^^
const El = Math.random() ? 'h1' : 'h2';
>El : "h1" | "h2"
> : ^^^^^^^^^^^
>Math.random() ? 'h1' : 'h2' : "h1" | "h2"
> : ^^^^^^^^^^^
>Math.random() : number
> : ^^^^^^
>Math.random : () => number
> : ^^^^^^
>Math : Math
> : ^^^^
>random : () => number
> : ^^^^^^
>'h1' : "h1"
> : ^^^^
>'h2' : "h2"
> : ^^^^
const tag = <El className="ok" key="key">{"Title"}</El>;
>tag : JSX.Element
> : ^^^^^^^^^^^
><El className="ok" key="key">{"Title"}</El> : JSX.Element
> : ^^^^^^^^^^^
>El : "h1" | "h2"
> : ^^^^^^^^^^^
>className : string
> : ^^^^^^
>key : string
> : ^^^^^^
>"Title" : "Title"
> : ^^^^^^^
>El : "h1" | "h2"
> : ^^^^^^^^^^^