DefinitelyTyped/types/react
Diogo Franco 02ff115ce9 [react] Workaround for --strictFunctionTypes (#24709)
* [react] Workaround for --strictFunctionTypes

Under --strictFunctionTypes, when assigning a class with `getDerivedStateFromProps` to `React.ComponentClass` or `React.ComponentType`, the type of the second argument was expected to be `Readonly<any>`, which is, actually, the same as `Readonly<{}>`.

This was preventing using classes that try to refer to the previous state in `getDerivedStateFromProps` from being given to HOC factories.

There are no tests as testing this change is only possible with `--strictFunctionTypes`, and the `tsconfig.json` here specifically disables it. Perhaps another PR should enable it.

* Add a test anyway

Though it wouldn't have failed unless `--strictFunctionTypes` were enabled.

* Fix lint error on the test
2018-04-04 06:10:25 +01:00
..
test [react] Workaround for --strictFunctionTypes (#24709) 2018-04-04 06:10:25 +01:00
v15 Add missing 'aria-controls' attribute to React WAI-ARIA typings 2018-03-15 12:12:39 -07:00
global.d.ts Sentence fragment 2018-02-26 12:12:31 -08:00
index.d.ts [react] Workaround for --strictFunctionTypes (#24709) 2018-04-04 06:10:25 +01:00
package.json [react] Use csstype for React.CSSProperties (#24688) 2018-04-03 22:11:25 +01:00
tsconfig.json Merge branch 'master' into 'react-no-lib' 2018-03-09 12:08:47 -08:00
tslint.json