使用@reach/router 时如何设置搜索参数?我只是使用了 props.history.push 但 props.history 仍然未定义。这是页面状态更改时的代码
const handleChangePage = page => {
setPage(page)
const query = new URLSearchParams(props.location.pathname)
props.history.push({
pathname: props.location.pathname,
search: query.toString(),
})
//??? I want to set page for url similar to /product?page=3&limit=4
}