2017-05-01 22:19:06 +02:00
|
|
|
// @filename: file.tsx
|
|
|
|
// @jsx: preserve
|
|
|
|
// @noLib: true
|
2017-10-04 23:43:35 +02:00
|
|
|
// @skipLibCheck: true
|
2017-05-01 22:19:06 +02:00
|
|
|
// @libFiles: react.d.ts,lib.d.ts
|
|
|
|
|
|
|
|
import React = require('react');
|
|
|
|
|
|
|
|
interface Prop {
|
|
|
|
a: number,
|
|
|
|
b: string
|
|
|
|
}
|
|
|
|
|
|
|
|
declare class MyComp<P extends Prop> extends React.Component<P, {}> {
|
|
|
|
internalProp: P;
|
|
|
|
}
|
|
|
|
|
2018-01-03 20:30:41 +01:00
|
|
|
// Error
|
2017-05-01 22:19:06 +02:00
|
|
|
let x1 = <MyComp />
|
|
|
|
|
2018-01-03 20:30:41 +01:00
|
|
|
// OK
|
2017-05-01 22:19:06 +02:00
|
|
|
let x = <MyComp a={10} b="hi" />
|
2018-01-03 20:30:41 +01:00
|
|
|
|
|
|
|
// Error
|
2017-05-01 22:19:06 +02:00
|
|
|
let x2 = <MyComp a="hi"/>
|