-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Consider the following:
declare module JSX {
interface ElementAttributesProperty { props: {}; }
}
class Component<P> {
props: P & { ref?: string };
}This results in the error: JSX element attributes type '[type parameter] & { ref?: string; }' must be an object type.
An alternative would be an additional member of the JSX namespace that allowed specifying "global" attributes (that would apply to both value-based and intrinsic elements). For example:
declare module JSX {
interface GlobalAttributes {
ref?: string
}
}See also DefinitelyTyped/DefinitelyTyped#5347
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue