swc/crates/swc_ecma_parser/tests/tsc/tsxAttributeResolution9.tsx
2022-02-04 17:08:38 +09:00

28 lines
407 B
TypeScript

//@jsx: preserve
//@module: amd
//@filename: react.d.ts
declare module JSX {
interface Element { }
interface IntrinsicElements {
}
interface ElementAttributesProperty {
props;
}
}
interface Props {
foo: string;
}
//@filename: file.tsx
export class MyComponent {
render() {
}
props: { foo: string; }
}
<MyComponent foo="bar" />; // ok
<MyComponent foo={0} />; // should be an error