31 lines
518 B
TypeScript
31 lines
518 B
TypeScript
|
// @filename: file.tsx
|
||
|
// @jsx: preserve
|
||
|
// @noLib: true
|
||
|
// @libFiles: react.d.ts,lib.d.ts
|
||
|
|
||
|
import React = require('react');
|
||
|
|
||
|
const obj = {};
|
||
|
const obj1 = {
|
||
|
x: 2
|
||
|
}
|
||
|
const obj3 = {
|
||
|
y: true,
|
||
|
overwrite: "hi"
|
||
|
}
|
||
|
|
||
|
interface Prop {
|
||
|
x: number
|
||
|
y: boolean
|
||
|
overwrite: string
|
||
|
}
|
||
|
|
||
|
class OverWriteAttr extends React.Component<Prop, {}> {
|
||
|
render() {
|
||
|
return <div>Hello</div>;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// OK
|
||
|
let x = <OverWriteAttr {...obj} y overwrite="hi" {...obj1} />
|
||
|
let x1 = <OverWriteAttr {...obj1} {...obj3} />
|