title: How to get params in component in react router dom v4?
body: <p>I have this code:</p>
  
  <pre><code>&lt;BrowserRouter&gt;
     &lt;Route  path="/(:filter)?" component={App} /&gt;
  &lt;/BrowserRouter&gt;
  </code></pre>
  
  <p>the filter param or '' on the root is suppose to be on App components' props base on the previous react router versions?</p>
  
  <p>This is my code on my App:</p>
  
  <pre><code>const App = ({params}) =&gt; {
      return ( // destructure params on props
        &lt;div&gt;
          &lt;AddTodo /&gt;
          &lt;VisibleTodoList 
              filter={params.filter || 'all'} // i want to git filter param or assign 'all' on root 
          /&gt;
          &lt;Footer /&gt;
        &lt;/div&gt;
      );
  }
  </code></pre>
  
  <p>I logged this.props.match.params on console but it has none? help?</p>