File: tsxStatelessFunctionComponents3.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (56 lines) | stat: -rw-r--r-- 1,481 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
=== tests/cases/conformance/jsx/file.tsx ===
import React = require('react');
>React : typeof React

const Foo = (props: any) => <div/>;
>Foo : (props: any) => JSX.Element
>(props: any) => <div/> : (props: any) => JSX.Element
>props : any
><div/> : JSX.Element
>div : any

// Should be OK
const foo = <Foo />;
>foo : JSX.Element
><Foo /> : JSX.Element
>Foo : (props: any) => JSX.Element


// Should be OK
var MainMenu: React.StatelessComponent<{}> = (props) => (<div>
>MainMenu : React.StatelessComponent<{}>
>React : any
>(props) => (<div>    <h3>Main Menu</h3></div>) : (props: { children?: React.ReactNode; }) => JSX.Element
>props : { children?: React.ReactNode; }
>(<div>    <h3>Main Menu</h3></div>) : JSX.Element
><div>    <h3>Main Menu</h3></div> : JSX.Element
>div : any

    <h3>Main Menu</h3>
><h3>Main Menu</h3> : JSX.Element
>h3 : any
>h3 : any

</div>);
>div : any

var App: React.StatelessComponent<{ children }> = ({children}) => (
>App : React.StatelessComponent<{ children: any; }>
>React : any
>children : any
>({children}) => (    <div >        <MainMenu/>	</div>) : ({ children }: { children: any; } & { children?: React.ReactNode; }) => JSX.Element
>children : any
>(    <div >        <MainMenu/>	</div>) : JSX.Element

    <div >
><div >        <MainMenu/>	</div> : JSX.Element
>div : any

        <MainMenu/>
><MainMenu/> : JSX.Element
>MainMenu : React.StatelessComponent<{}>

	</div>
>div : any

);