mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
27 lines
443 B
TypeScript
27 lines
443 B
TypeScript
// @filename: file.tsx
|
|
// @jsx: preserve
|
|
// @noLib: true
|
|
// @skipLibCheck: true
|
|
// @libFiles: react.d.ts,lib.d.ts
|
|
|
|
import React = require('react');
|
|
|
|
interface PoisonedProp {
|
|
x: string;
|
|
y: number;
|
|
}
|
|
|
|
class Poisoned extends React.Component<PoisonedProp, {}> {
|
|
render() {
|
|
return <div>Hello</div>;
|
|
}
|
|
}
|
|
|
|
const obj = {
|
|
x: "hello world",
|
|
y: 2
|
|
};
|
|
|
|
// OK
|
|
let p = <Poisoned {...obj} />;
|
|
let y = <Poisoned x="hi" y={2} />; |