In my application I have a query string that I want to remove after a button click.
I get the query string like this:
import qs from 'query-string'
// ..
const { search } = url
const { id } = qs.parse(search)
Then when I click on the button, I want to remove the string without reloading the page.
const onClick = () => {
history.push({})
}
However the code above doesn't work as expected.