From 2ac0dc0c50d134dda95077b62063326636b4d0ed Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Sat, 18 Mar 2017 11:18:25 -0700 Subject: [PATCH] Make React.ValidationMap only accept keys from T. --- react/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index cf3afd9661..0a26b01a0e 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -2627,9 +2627,7 @@ declare namespace React { isRequired: Validator; } - interface ValidationMap { - [key: string]: Validator; - } + type ValidationMap = { [K in keyof T]?: Validator }; interface ReactPropTypes { any: Requireable;