From 1737fbff88a1cd1bc43eaa1c74a6f62a9e485f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Guillot?= Date: Thu, 2 Jun 2016 17:49:05 +0200 Subject: [PATCH] Typing Location.Query to K,V dictionary (#9524) * Typing Location.Query to K,V dictionary Location.Query is actually typed as 'Object', which forces to cast it to 'any' anytime you need to access one of your own query string parameter. const clientId = (this.props.location.query as any).clientId; It should be typed as '{ [key: string]: string; }' since it's a dictionary where you can get your arbitrary named query string parameters. * Fixing travis build --- react-router/history.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-router/history.d.ts b/react-router/history.d.ts index 1af2d26993..45dc4d26e4 100644 --- a/react-router/history.d.ts +++ b/react-router/history.d.ts @@ -90,7 +90,7 @@ declare namespace HistoryModule { type Pathname = string - type Query = Object + type Query = { [key: string]: any; } type QueryString = string