swc/crates/swc_ecma_parser/tests/tsc/tsxSpreadAttributesResolution17.tsx

26 lines
503 B
TypeScript
Raw Normal View History

// @strictNullChecks: true
// @filename: file.tsx
// @jsx: preserve
// @noLib: true
// @skipLibCheck: true
// @libFiles: lib.d.ts
declare global {
namespace JSX {
interface Element {}
interface ElementAttributesProperty { props: {} }
}
}
declare var React: any;
export class Empty extends React.Component<{}, {}> {
render() {
return <div>Hello</div>;
}
}
declare const obj: { a: number | undefined } | undefined;
// OK
let unionedSpread = <Empty {...obj} />;