-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.0
Code
interface IProps {
primaryText: string,
[propName: string]: any
}
function VerticalNavMenuItem(props: IProps) {
return <div>props.primaryText</div>
}
function VerticalNav() {
return (
<div>
<SOME_JSX />
<VerticalNavMenuItem primaryText={2} />
</div>
)
}
Expected behavior:
In VerticalNav I have the child component: <VerticalNavMenuItem primaryText={2} />
This should throw a type error because primary text must be a string.
However, if I remove [propName: string]: any
from IProps then the type error will be thrown.
Actual behavior:
No error is thrown.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSX/TSXRelates to the JSX parser and emitterRelates to the JSX parser and emitterFixedA PR has been merged for this issueA PR has been merged for this issue