Commit Graph

9 Commits

Author SHA1 Message Date
Sean Kelley
b9642fb8ac Allow specifying void for component state type parameter. (#8673)
* Allow specifying `void` for component state type parameter.

Per comments on https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8543,
the type parameter for component state was changed to `{}` from `any` for
increased type safety, but prevents specifying (non-functional) stateless
components without having empty state parameters, which seems messy. This
changes the type to `{} | void` to allow this while staying stricter than
`any`.

* Make react tests a bit more strict.

* Rename State -> ComponentState to make it a bit more explicit.
2016-04-13 00:40:40 +09:00
vvakame
56295f5058 replace https://github.com/borisyankov/DefinitelyTyped to https://github.com/DefinitelyTyped/DefinitelyTyped 2016-03-17 00:55:26 +09:00
Vincent Siao
1a67b639ce [react] Add ComponentElement<P, T> for instance type inference 2016-03-14 02:05:24 -07:00
Vincent Siao
1917a4122a [react] Add T param to React.DOM* types 2016-03-14 01:46:13 -07:00
Adi Dahiya
ca5bfe76d2 Fix linting errors in react typings 2015-11-18 14:37:45 -05:00
Vincent Siao
a43c2843cd [React.14] Add ReactInstance type (Component<any, any> | Element) 2015-11-05 11:25:16 -08:00
Vincent Siao
15eff541e0 [React.14] Update refs for DOM elements 2015-11-05 10:41:07 -08:00
James Brantly
f9e6e567f4 Fix module => namespace 2015-10-14 20:55:48 -04:00
James Brantly
77b2f7e8d4 Initial React v0.14 definitions 2015-10-14 19:21:31 -04:00