//You can use useHistory() inany component,
//but props.history onlyin components where the history is available in props
//When you use history.push, you doNOT have to specify the pathname.
const queryString = new URLSearchParams(params).toString()
history.push({
search: "?" + queryString
});