mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
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:
committed by
Masahiro Wakame
parent
a02593d277
commit
1737fbff88
Vendored
+1
-1
@@ -90,7 +90,7 @@ declare namespace HistoryModule {
|
||||
|
||||
type Pathname = string
|
||||
|
||||
type Query = Object
|
||||
type Query = { [key: string]: any; }
|
||||
|
||||
type QueryString = string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user