When
Current location is http://localhost?a=a#b
Do
history.push('/');
// OR
history.replace('/');
Expect
Location change to http://localhost
Actual
Location still is http://localhost?a=a#b
Got the same issue
Yeah, this definitely seems like a bug to me too as it's a breaking change that is not documented with the 5.0.0 release, and just feels very unintuitive.
https://github.com/ReactTraining/history/releases/tag/v5.0.0
I think what I am seeing the same issue, but with "createHashHistory":
http://localhost:8080/esp/files/index.html#/main?lastNDays=31&protected=false&state=completedhttp://localhost:8080/esp/files/index.html#/main?lastNDays=999&protected=truehistory.listen I still get: ?lastNDays=31&protected=false&state=completed for the search...Here's my workaround:
const push = (to, state) => history.push({
hash: '',
search: '',
...(typeof to === 'string' ? parsePath(to) : to)
}, state)
It looks more like a bug than a feature 馃
same is here #808
Most helpful comment
Got the same issue