TypeScript/tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx

34 lines
697 B
TypeScript
Raw Normal View History

2017-05-05 19:05:50 +02:00
// @filename: file.tsx
// @jsx: preserve
// @noLib: true
// @skipLibCheck: true
2017-05-05 19:05:50 +02:00
// @libFiles: react.d.ts,lib.d.ts
// @strictNullChecks: true
2017-05-05 19:05:50 +02:00
import React = require('react');
interface ButtonProp {
a: number,
b: string,
children: Button;
}
class Button extends React.Component<ButtonProp, any> {
render() {
// Error children are specified twice
return (<InnerButton {...this.props} children="hi">
<div>Hello World</div>
</InnerButton>);
}
}
interface InnerButtonProp {
a: number
}
class InnerButton extends React.Component<InnerButtonProp, any> {
render() {
return (<button>Hello</button>);
}
}