mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 02:29:04 +03:00
34 lines
664 B
TypeScript
34 lines
664 B
TypeScript
// @filename: file.tsx
|
|
// @jsx: preserve
|
|
// @noLib: true
|
|
// @skipLibCheck: true
|
|
// @libFiles: react.d.ts,lib.d.ts
|
|
// @strictNullChecks: true
|
|
|
|
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>);
|
|
}
|
|
}
|