Files
DefinitelyTyped/types/react/test
Nathan Shively-Sanders 0d61b71678 Improve React.DOMElement type parameter for 2.4 weak type checks
DOMAttributes, HTMLAttributes and SVGAttributes are all weak types.
In React.DOMElement, people always pass either HTMLAttributes or
SVGAttributes, so the type parameter is just constrained to
DOMAttributes. This is not as good as a union of (HTML | SVGAttrs) for 2
reasons:

1. Valid HTMLAttributes objects that don't include some DOMAttributes
properties fail TS 2.4's weak type check.
2. Invalid HTMLAttributes objects don't get type checking for
HTMLAttributes properties.

For example:

```ts
var e: React.DOMElement<{
  style: {
    checked: "no"
  }
}, Element>;
```

But `checked` is actually a boolean. Previously, this was not an error.
2017-06-28 09:39:36 -07:00
..