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

32 lines
448 B
TypeScript

//@jsx: preserve
//@module: amd
//@filename: react.d.ts
declare module JSX {
interface Element { }
interface IntrinsicElements {
}
interface ElementAttributesProperty {
props;
}
}
//@filename: file.tsx
export class MyComponent {
render() {
}
props: {
[s: string]: boolean;
}
}
// Should be an error
<MyComponent bar='world' />;
// Should be OK
<MyComponent bar={true} />;
// Should be ok
<MyComponent data-bar='hello' />;