title: Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function` Error using react-router-dom
body: <p>I am Trying to use <strong>react-router-dom</strong>. When I export my component as</p>
  
  <pre><code>class RandomComponent { // component code}
  export default RandomComponent;
  </code></pre>
  
  <p>and use this as a component in Route as following -</p>
  
  <pre><code>&lt;Route path="/" exact component={RandomComponent} /&gt;
  </code></pre>
  
  <p>I get following warning in chrome console -</p>
  
  <p><strong>Warning: Failed prop type: Invalid prop <code>component</code> of type <code>object</code> supplied to <code>Route</code>, expected <code>function</code></strong></p>
  
  <p>But When I export my component using </p>
  
  <pre><code>export class RandomComponent{ // component code}
  </code></pre>
  
  <p>same piece of code starts working, can someone explain me why this is happening? thanks in advance.</p>