File: tsxUnionTypeComponent1.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (57 lines) | stat: -rw-r--r-- 2,556 bytes parent folder | download | duplicates (5)
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
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react');
>React : Symbol(React, Decl(file.tsx, 0, 0))

interface ComponentProps {
>ComponentProps : Symbol(ComponentProps, Decl(file.tsx, 0, 32))

    AnyComponent: React.StatelessComponent<any> | React.ComponentClass<any>;
>AnyComponent : Symbol(ComponentProps.AnyComponent, Decl(file.tsx, 2, 26))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>StatelessComponent : Symbol(React.StatelessComponent, Decl(react.d.ts, 198, 40))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>ComponentClass : Symbol(React.ComponentClass, Decl(react.d.ts, 205, 5))
}

class MyComponent extends React.Component<ComponentProps, {}> {
>MyComponent : Symbol(MyComponent, Decl(file.tsx, 4, 1))
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>ComponentProps : Symbol(ComponentProps, Decl(file.tsx, 0, 32))

    render() {
>render : Symbol(MyComponent.render, Decl(file.tsx, 6, 63))

        const { AnyComponent } = this.props;
>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 8, 15))
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))
>this : Symbol(MyComponent, Decl(file.tsx, 4, 1))
>props : Symbol(React.Component.props, Decl(react.d.ts, 167, 37))

        return (<AnyComponent />);
>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 8, 15))
    }
}

// Stateless Component As Props
<MyComponent AnyComponent={() => <button>test</button>}/>
>MyComponent : Symbol(MyComponent, Decl(file.tsx, 4, 1))
>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 14, 12))
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2386, 43))

// Component Class as Props
class MyButtonComponent extends React.Component<{},{}> {
>MyButtonComponent : Symbol(MyButtonComponent, Decl(file.tsx, 14, 57))
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
>React : Symbol(React, Decl(file.tsx, 0, 0))
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55), Decl(react.d.ts, 161, 66))
}

<MyComponent AnyComponent={MyButtonComponent} />
>MyComponent : Symbol(MyComponent, Decl(file.tsx, 4, 1))
>AnyComponent : Symbol(AnyComponent, Decl(file.tsx, 20, 12))
>MyButtonComponent : Symbol(MyButtonComponent, Decl(file.tsx, 14, 57))