-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property 'query' does not exist on type 'Location<unknown> #472
Comments
Looks like a release of latest master would resolve this #410. |
Please release master! |
I think that release was published in February. I have 6.9.1 which says there should be a query object in the action payload (according to the TS defs), but it is coming through without. Not sure if I've missed something in the docs, but I might have to manually parse the "search" string instead: {
"type": "@@router/LOCATION_CHANGE",
"payload": {
"location": {
"pathname": "/",
"search": "?param=yourmom",
"hash": ""
},
"action": "POP",
"isFirstRendering": true
}
} export interface LocationChangeAction<S = LocationState> {
type: typeof LOCATION_CHANGE;
payload: LocationChangePayload<S>;
}
export interface LocationChangePayload<S = LocationState> extends RouterState<S> {
isFirstRendering: boolean;
}
export interface RouterState<S = LocationState> {
location: RouterLocation<S>
action: RouterActionType
}
export interface RouterLocation<S> extends Location<S> {
query: Record<string, string> /// nope
} |
The TS def for the |
Presumably this is an easy fix if we have a decision on what the correct resolution is. I suppose removing query from the action would be the simplest resolution. @supasate are you the Lord High Decision-maker here, or can someone rock up with a PR? |
My dependencies :
I want to use query like this
http://localhost:3000/course?grade=item1&genre_name=item2&instrument_name=item3
and want to get query parameter fromconnected-react-router
like this :It works perfect :
Error :
Property 'query' does not exist on type 'Location<unknown>'.ts(2339)
How can I add this on Location type and fix this error ?
The text was updated successfully, but these errors were encountered: