{"action":"created","issue":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/3863","repository_url":"https://api.github.com/repos/ReactTraining/react-router","labels_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3863/labels{/name}","comments_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3863/comments","events_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3863/events","html_url":"https://github.com/ReactTraining/react-router/issues/3863","id":177188596,"number":3863,"title":"Query parameter datatype confusion","user":{"login":"jochenberger","id":370733,"avatar_url":"https://avatars.githubusercontent.com/u/370733?v=3","gravatar_id":"","url":"https://api.github.com/users/jochenberger","html_url":"https://github.com/jochenberger","followers_url":"https://api.github.com/users/jochenberger/followers","following_url":"https://api.github.com/users/jochenberger/following{/other_user}","gists_url":"https://api.github.com/users/jochenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jochenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jochenberger/subscriptions","organizations_url":"https://api.github.com/users/jochenberger/orgs","repos_url":"https://api.github.com/users/jochenberger/repos","events_url":"https://api.github.com/users/jochenberger/events{/privacy}","received_events_url":"https://api.github.com/users/jochenberger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ReactTraining/react-router/milestones/18","html_url":"https://github.com/ReactTraining/react-router/milestones/v4.0.0","labels_url":"https://api.github.com/repos/ReactTraining/react-router/milestones/18/labels","id":1961834,"number":18,"title":"v4.0.0","description":"","creator":{"login":"timdorr","id":17882,"avatar_url":"https://avatars.githubusercontent.com/u/17882?v=3","gravatar_id":"","url":"https://api.github.com/users/timdorr","html_url":"https://github.com/timdorr","followers_url":"https://api.github.com/users/timdorr/followers","following_url":"https://api.github.com/users/timdorr/following{/other_user}","gists_url":"https://api.github.com/users/timdorr/gists{/gist_id}","starred_url":"https://api.github.com/users/timdorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timdorr/subscriptions","organizations_url":"https://api.github.com/users/timdorr/orgs","repos_url":"https://api.github.com/users/timdorr/repos","events_url":"https://api.github.com/users/timdorr/events{/privacy}","received_events_url":"https://api.github.com/users/timdorr/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":4,"state":"open","created_at":"2016-08-24T22:46:03Z","updated_at":"2016-09-15T16:05:42Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-09-15T14:14:02Z","updated_at":"2016-09-15T16:26:50Z","closed_at":null,"body":"On one of my pages, where I have a paging table, I store the page number as a query parameter. I use a number in the Link target, e.g. `<Link to={{query:{page:2}}}>Page 2</Link>`.\r\nWhen the component re-renders after I click on the `Link`, `props.location.query.page` is a `number`. However, if I reload the page so that `window.location.search` is parsed again, `props.location.query.page` is a `string`.\r\nIn Router v2, query parameter values were always coerced to `string` btw."},"comment":{"url":"https://api.github.com/repos/ReactTraining/react-router/issues/comments/247378747","html_url":"https://github.com/ReactTraining/react-router/issues/3863#issuecomment-247378747","issue_url":"https://api.github.com/repos/ReactTraining/react-router/issues/3863","id":247378747,"user":{"login":"jochenberger","id":370733,"avatar_url":"https://avatars.githubusercontent.com/u/370733?v=3","gravatar_id":"","url":"https://api.github.com/users/jochenberger","html_url":"https://github.com/jochenberger","followers_url":"https://api.github.com/users/jochenberger/followers","following_url":"https://api.github.com/users/jochenberger/following{/other_user}","gists_url":"https://api.github.com/users/jochenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/jochenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jochenberger/subscriptions","organizations_url":"https://api.github.com/users/jochenberger/orgs","repos_url":"https://api.github.com/users/jochenberger/repos","events_url":"https://api.github.com/users/jochenberger/events{/privacy}","received_events_url":"https://api.github.com/users/jochenberger/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T16:26:50Z","updated_at":"2016-09-15T16:26:50Z","body":"That wouldn't help. The discrepancy is caused by the fact that router keeps the data type intact internally but does no coercion of the values that come out of the query parser. IMO, either it should be possible to specify data types for path/query params or, for thr sake of consistency, everything should be converted to strings internally."}}
{"actor":{"display_login":"jochenberger"}}