title: How to update query param in url in React?
body: <p>I am trying to create pagination in my web application using react-js-pagination. Pagination is showing in webpage but i want to change page param inside url according to page number like <code>&amp;page=4</code>. I tried to use </p>
  
  <pre><code>this.props.history.push(`${window.location.search}&amp;page=${pageNumber}`)
  </code></pre>
  
  <p>but this is appending <code>&amp;page=4</code> everytime i click on pagination link. I know this wrong way to update url. How can i update only page parameter according to pageNumber in url?</p>
  
  <pre><code>handlePageChange = (pageNumber) =&gt; {
   this.setState({activePage: pageNumber});
   this.props.history.push(`${window.location.search}&amp;page=${pageNumber}`)
  }
  
  &lt;Pagination
      activePage={this.state.activePage}
      itemsCountPerPage={10}
      totalItemsCount={100}
      onChange={this.handlePageChange}
  /&gt;
  </code></pre>