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
|
=== tests/cases/compiler/my-component.tsx ===
import * as React from 'react'
>React : typeof React
interface MyProps {
x: string;
>x : string
y: MyInnerProps;
>y : MyInnerProps
}
interface MyInnerProps {
value: string;
>value : string
}
export function MyComponent(_props: MyProps) {
>MyComponent : (_props: MyProps) => JSX.Element
>_props : MyProps
return <span>my component</span>;
><span>my component</span> : JSX.Element
>span : any
>span : any
}
=== tests/cases/compiler/file1.tsx ===
import * as React from 'react'
>React : typeof React
import { MyComponent } from './my-component'
>MyComponent : (_props: MyProps) => JSX.Element
export const result = <MyComponent x="yes" y={{
>result : JSX.Element
><MyComponent x="yes" y={{ value: 42}} /> : JSX.Element
>MyComponent : (_props: MyProps) => JSX.Element
>x : string
>y : { value: number; }
>{ value: 42} : { value: number; }
value: 42
>value : number
>42 : 42
}} />;
|