title: React router v4 - preserve query params while navigation
body: <p>I am using React Router v4 for routing in my application. The only issue I have is the query params are ignored while navigation from one route to another. Is there a way to just replace the path and preserve the query params.</p>
  
  <p>Below is my code:</p>
  
  <pre><code>&lt;Switch&gt;
    &lt;Route exact path="/" component={() =&gt; &lt;Redirect to="/Route1" /&gt;}/&gt;
    &lt;Route exact path='/Route1' component={Route1Comp} /&gt;
    &lt;Route path='/Route1/:channel/:id?'
      render={(routeProps) =&gt; (
        &lt;AppMain {...routeProps} /&gt;
      )}
    /&gt;
    &lt;Route exact path='/Route2' component={Route2Comp} /&gt;
  &lt;/Switch&gt;
  </code></pre>
  
  <p>I need the app to have a query param <code>?isDev=true</code> and want to retain across. Currently if I am on <code>localhost:3000/Route1Comp?isDev=true</code> and navigate to <code>Route2Comp</code> using <code>Link</code> then the entire path is replaced along with query params.</p>