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
|
=== tests/cases/compiler/tsxStatelessComponentDefaultProps.tsx ===
/// <reference path="react16.d.ts" />
import React from 'react';
>React : typeof React
interface Props {
text: string;
>text : string
}
function BackButton(_props: Props) {
>BackButton : typeof BackButton
>_props : Props
return <div />
><div /> : JSX.Element
>div : any
}
BackButton.defaultProps = {
>BackButton.defaultProps = { text: 'Go Back',} : { text: string; }
>BackButton.defaultProps : { text: string; }
>BackButton : typeof BackButton
>defaultProps : { text: string; }
>{ text: 'Go Back',} : { text: string; }
text: 'Go Back',
>text : string
>'Go Back' : "Go Back"
};
let a = <BackButton />
>a : JSX.Element
><BackButton /> : JSX.Element
>BackButton : typeof BackButton
|