mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
b887b30092
**Description:** This is required for https://github.com/swc-project/swc/pull/6981 and https://github.com/swc-project/swc/pull/6950
32 lines
687 B
TypeScript
32 lines
687 B
TypeScript
//@jsx: preserve
|
|
//@module: amd
|
|
|
|
//@filename: react.d.ts
|
|
declare module JSX {
|
|
interface Element { }
|
|
interface IntrinsicElements {
|
|
div: any;
|
|
}
|
|
interface ElementAttributesProperty { prop: any }
|
|
}
|
|
|
|
//@filename: file.tsx
|
|
|
|
interface IProps {
|
|
primaryText: string,
|
|
[propName: string]: string | number
|
|
}
|
|
|
|
function VerticalNavMenuItem(prop: IProps) {
|
|
return <div>props.primaryText</div>
|
|
}
|
|
|
|
function VerticalNav() {
|
|
return (
|
|
<div>
|
|
<VerticalNavMenuItem primaryText={2} /> // error
|
|
<VerticalNavMenuItem justRandomProp={2} primaryText={"hello"} /> // ok
|
|
<VerticalNavMenuItem justRandomProp1={true} primaryText={"hello"} /> // error
|
|
</div>
|
|
)
|
|
}
|