Commit Graph

63 Commits

Author SHA1 Message Date
Mike Deverell
c3f41ac81b 'autoComplete' should be lowercase 'autocomplete' 2017-07-22 22:32:57 -04:00
Mike Deverell
801ffc3751 add myself (devrelm) to the contributors list 2017-07-22 22:32:57 -04:00
Mike Deverell
d9420c7ffc add missing textarea attributes 2017-07-22 22:32:57 -04:00
sboehler
4fd96da0fe Fix value prop in select element 2017-07-11 17:45:49 +02:00
Stéphane Goetz
a24aee6125 Improve react typings for HTML attributes, fix tests in other libraries 2017-07-10 22:43:07 +02:00
Ryan Cavanaugh
fec422d226 Merge pull request #17611 from tkrotoff/react-router-component
Refactoring: use React.ComponentType
2017-07-10 09:41:41 -07:00
Nathan Shively-Sanders
cc271b097d Merge branch 'master' into improve-react-domelement-type-parameter 2017-07-06 09:37:55 -07:00
Dovydas Navickas
929b4a206d Fixes for comments. 2017-06-29 20:57:10 +03:00
Dovydas Navickas
429ff58c9e Added string fallback for type in ReactElement and DOMElement. This is needed for cusotm web-comonents. 2017-06-29 19:28:46 +03:00
Dovydas Navickas
da4a5b2bc7 Merge branch 'patch-5' of https://github.com/DovydasNavickas/DefinitelyTyped into patch-5 2017-06-29 19:26:02 +03:00
Dovydas Navickas
0af3e88ce6 Added React.createElement overload for DOMElement. 2017-06-29 18:29:24 +03:00
Dovydas Navickas
05b4b728e3 Merge branch 'master' into patch-5 2017-06-29 18:20:29 +03:00
Dovydas Navickas
fc3bbed6db React.cloneElement overloads for ReactHTMLElement and SVGElement added. 2017-06-29 17:44:15 +03:00
Dovydas Navickas
d3901d1290 Tslint disabling updated to disable only one line. 2017-06-29 15:28:23 +03:00
Tanguy Krotoff
5addbe9b72 React.ComponentType<P> => React.ComponentType<P = {}> 2017-06-29 14:00:19 +02:00
Dovydas Navickas
e94d1c1c03 React tslint errors fixed. 2017-06-29 14:43:22 +03:00
Nathan Shively-Sanders
15b7bac319 Add a string-fallback overload to React.createElement
The types aren't quite as nice as when providing a string literal like
"div" or "input", but it works as well as it did before the
string-literal-overload change in #17507.
2017-06-28 15:00:56 -07:00
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
Dovydas Navickas
9e62632e24 Added tslint.json for react. 2017-06-28 15:03:32 +03:00
Jacob Rask
c7fcc11729 Remove references to removed section in React README
setState issues were removed.
2017-06-28 13:32:59 +02:00
Dovydas Navickas
a4adb4ff04 dts-lint error fixed in jsnox. 2017-06-28 13:01:06 +03:00
Dovydas Navickas
354aa9339c Expanded type with ReactSVG. 2017-06-28 03:39:29 +03:00
Dovydas Navickas
5630ea2dec Unified type parameter and property types. 2017-06-28 01:25:19 +03:00
Nathan Shively-Sanders
b5eb45232a Better constraint for React.createElement for SVG 2017-06-26 15:31:09 -07:00
Nathan Shively-Sanders
e6a401f7da React.createElement has more specific return types 2017-06-26 14:48:23 -07:00
Nathan Shively-Sanders
0a2007983a createElement splits SVG/HTML props based on type parameter
This is required for 2.4 to avoid a weak type error since DOMAttributes
is a weak type.
2017-06-26 11:26:52 -07:00
Gaspard Bucher
3d4ac4abf9 [types/react] Allow null return from stateless components.
Fixes #14064
2017-06-26 16:16:07 +02:00
Tanguy Krotoff
b0c9072f43 Change React.Component<P, ...> to React.Component<P = {}, ...> 2017-06-21 09:47:00 +02:00
Tanguy Krotoff
b81d97133a Merge branch 'master' into react-default-type-arguments 2017-06-20 22:39:06 +02:00
Albert Kurniawan
f3527f0040 Updated Ref signature to handle null cases 2017-06-20 10:16:26 +10:00
Tanguy Krotoff
ea9de8a518 Replace React.Component<(.*), (any|void|\{\}|null)> by React.Component<$1>
+ many manual adjustments
2017-06-19 13:35:50 +02:00
Tanguy Krotoff
3c9eba9d3f Change React.Component<P, S> to React.Component<P, S = {}> 2017-06-19 13:35:47 +02:00
Tanguy Krotoff
eeb262e1d8 Update react to TypeScript 2.3 2017-06-19 13:34:54 +02:00
Tanguy Krotoff
53225789d9 "Definitions by:" on multiple lines for better readability 2017-06-19 12:09:54 +02:00
Tanguy Krotoff
27acfc741a Change require('react') to import * as React from 'react' 2017-06-19 12:09:31 +02:00
Nathan Shively-Sanders
a575e086a2 Merge pull request #17224 from DefinitelyTyped/weak-type-errors-round-2
Fix primitive weak type errors
2017-06-15 17:33:16 -07:00
Mine Starks
7b4d7f7ed8 Merge pull request #17082 from rapilabs/react-invalid-event
react: Added InvalidEvent, onInvalid & onInvalidCapture
2017-06-15 12:47:45 -07:00
Nathan Shively-Sanders
4874667de9 Fix primitive weak type errors
These weak type errors were not caught in TS 2.4 RC. The final TS 2.4
will catch weak type errors with primitives, so this PR fixes those
now-caught errors.
2017-06-15 11:46:46 -07:00
Mine Starks
7ee78ab8b5 Merge pull request #16941 from dyst5422/patch-2
React: Add animateTransform SVG element to JSX.IntrinsicElements
2017-06-15 11:21:22 -07:00
David Sanders
8c19e8e886 Added InvalidEvent, onInvalid & onInvalidCapture
https://developer.mozilla.org/en-US/docs/Web/Events/invalid
2017-06-09 19:58:09 +10:00
Julien Roncaglia
18949a7319 Allow false as a result of React render()
`false` is treated the same as `null` when returned from `render()` in react but it wasn't allowed in the typings
2017-06-07 11:19:58 +02:00
Nathan Shively-Sanders
163f4438df Fix weak type errors (#16845)
* Fix first round of weak type errors

Done through griddle-react

* 95% done with weak type fixes

* Fix last couple of weak type errors

* Remove some lint from mithril tests

* mithril's Lifecycle is not a weak type any more

Restore the Lifecycle constraints in the rest of the definitions.

* Fix react-redux tests after #16652 broke them

* Remove package-lock.json
2017-06-04 22:03:03 -07:00
dyst5422
eeef424526 Add animateTransform SVG element to JSX.IntrinsicElements
The animateTransform SVG element was missing from JSX.IntrinsicElements.

Like the SVG animate element, this will need to be refined when  TypeScript's lib.dom.d.ts is updated to include SVGAnimateTransformElement.
2017-06-03 09:10:23 -07:00
Michael Elsdörfer
3b14b0a3a3 Add role and tabIndex back to SVGAttributes. (#16289)
Was removed as a part of https://github.com/DefinitelyTyped/DefinitelyTyped/pull/14618.
2017-06-01 08:04:49 -07:00
Cameron Little
5552b831b9 Update index.d.ts 2017-05-25 13:06:38 -07:00
Cameron Little
c34962bc59 Update index.d.ts 2017-05-25 09:29:01 -07:00
Cameron Little
bedfaf0249 Update index.d.ts 2017-05-24 09:40:34 -07:00
Cameron Little
a524192bf5 Add Component<P> class
This allows declaring a parameter or variable as a general "component with props P" instead of needing to declare it class based or function.
2017-05-24 09:34:25 -07:00
Nathan Shively-Sanders
43d74e2dfe Add a Component interface that merges w/the class
The Component interface extends ComponentLifecycle. ComponentLifecycle
goes back to being an interface.

Also fix some lint in react-virtualized
2017-05-24 09:15:22 -07:00
Nathan Shively-Sanders
dde2a7a3ba Change react's ComponentLifecycle to class
ComponentLifecycle is intended to provide some methods to Component
subclasses and enforce that overrides of those methods are correct in
those same subclasses.

However, it does neither of these things as an interface that
Component `implements`. It just checks that Component has all the
required methods of ComponentLifecycle. Since there are no required
methods, the `implements` check passes. And since Component doesn't
actually *implement* any of the methods, its subclasses don't get
them by default, and their 'overrides' are not checked for
correctness.

Changing ComponentLifecycle to a class fixes both of these problems.
2017-05-24 07:46:27 -07:00