DefinitelyTyped/types/react/test
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
..
cssProperties.tsx
index.ts Removed "dom" from React types tsconfig.json 2018-02-20 15:30:53 -05:00
tsx.tsx [react] Workaround for --strictFunctionTypes (#24709) 2018-04-04 06:10:25 +01:00