TypeScript/tests/cases/conformance/jsx/checkJsxChildrenProperty3.tsx
Wesley Wigham 25c3b99f29 Add skip lib check to many tests (#18935)
* Add skip lib check to many tests, do not include unit test duration in profiler duration

* Add a few more skipLibCheck flags

* A few more

* Add more skip lib check flags
2017-10-04 13:14:05 -07:00

45 lines
831 B
TypeScript

// @filename: file.tsx
// @jsx: preserve
// @noLib: true
// @skipLibCheck: true
// @libFiles: react.d.ts,lib.d.ts
import React = require('react');
interface IUser {
Name: string;
}
interface IFetchUserProps {
children: (user: IUser) => JSX.Element;
}
class FetchUser extends React.Component<IFetchUserProps, any> {
render() {
return this.state
? this.props.children(this.state.result)
: null;
}
}
// Ok
function UserName0() {
return (
<FetchUser>
{ user => (
<h1>{ user.Name }</h1>
) }
</FetchUser>
);
}
function UserName1() {
return (
<FetchUser>
{ user => (
<h1>{ user.Name }</h1>
) }
</FetchUser>
);
}