title: How to set route with optional query parameter using React router?
body: <p>I have a path as </p>
  
  <pre><code> &lt;Route path="/account/:accountid/LoginPage"
        component={LoginPage}/&gt;
  </code></pre>
  
  <p>This works fine if the url is -> <code>/account/12332/LoginPage</code>. I want to have optional query parameters. Url structure would be something as</p>
  
  <pre><code>/account/12322/LoginPage?User=A&amp;User=B
  </code></pre>
  
  <p>I have modified the path as</p>
  
  <pre><code>&lt;Route path="/account/:accountid/LoginPage(/:User)"
        component={LoginPage}/&gt;
  </code></pre>
  
  <p>after this if I try to access the url it does not redirect me to the appropriate page instead it throws an error as </p>
  
  <pre><code>useBasename.js:56 Uncaught TypeError: history.getCurrentLocation is not a function
      at Object.getCurrentLocation (useBasename.js:56)
      at Object.getCurrentLocation (useQueries.js:64)
      at Object.listen (createTransitionManager.js:246)
      at Object.componentWillMount (Router.js:97)
      at ReactCompositeComponent.js:347
      at measureLifeCyclePerf (ReactCompositeComponent.js:75)
      at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:346)
      at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:257)
      at Object.mountComponent (ReactReconciler.js:45)
      at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:370)
  </code></pre>