mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
//// [tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx] ////
|
|
|
|
//// [file.tsx]
|
|
/// <reference path="/.lib/react.d.ts" />
|
|
|
|
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>);
|
|
}
|
|
}
|
|
|
|
|
|
//// [file.jsx]
|
|
"use strict";
|
|
/// <reference path="/.lib/react.d.ts" />
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const React = require("react");
|
|
class Button extends React.Component {
|
|
render() {
|
|
// Error children are specified twice
|
|
return (<InnerButton {...this.props} children="hi">
|
|
<div>Hello World</div>
|
|
</InnerButton>);
|
|
}
|
|
}
|
|
class InnerButton extends React.Component {
|
|
render() {
|
|
return (<button>Hello</button>);
|
|
}
|
|
}
|