Make React.ValidationMap only accept keys from T.

This commit is contained in:
Sean Kelley
2017-03-18 11:18:25 -07:00
parent aa50ecddf9
commit 2ac0dc0c50

4
react/index.d.ts vendored
View File

@@ -2627,9 +2627,7 @@ declare namespace React {
isRequired: Validator<T>;
}
interface ValidationMap<T> {
[key: string]: Validator<T>;
}
type ValidationMap<T> = { [K in keyof T]?: Validator<T> };
interface ReactPropTypes {
any: Requireable<any>;