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
This commit is contained in:
François Guillot
2016-06-03 00:49:05 +09:00
committed by Masahiro Wakame
parent a02593d277
commit 1737fbff88
+1 -1
View File
@@ -90,7 +90,7 @@ declare namespace HistoryModule {
type Pathname = string
type Query = Object
type Query = { [key: string]: any; }
type QueryString = string