title: Passing optional parameter in react router
body: <p>Say I have <code>http://www.example.com/page/#/search</code> routed like this:</p>
  
  <pre><code>&lt;Router history={hashHistory}&gt;
    &lt;Route path='/search/' component={SearchPage} /&gt;
  &lt;/Router&gt;
  </code></pre>
  
  <p>And when the user does a search on the page using the provided <code>name</code> and <code>age</code> search boxes (either can be left out, or both can be filled), I want it to redirect to:</p>
  
  <pre><code>http://www.example.com/page/#/search/?name=whatever%20name&amp;age=15
  </code></pre>
  
  <p>Which will display the results for this particular search. This would also allow linking directly to search results.</p>
  
  <p>Now inside my <code>SearchPage</code> component, how can I check if <code>?name=</code> or <code>?age=</code> or any other search parameters have been provided?</p>