title: React router v4.2.2: using a string instead of function inside component prop of Route results in error
body: <p>I am using react-router v4.2.2 and am trying to use a function to spit out a list of routes with a component property value of "project.title", taken from a reducer I am using. However, when I write:</p>
  
  <pre><code>return &lt;Route key={i} exact path={`/${project.title}`} exact component={project.title}/&gt;
  </code></pre>
  
  <p>using the project.title part results in this error: </p>
  
  <blockquote>
    <p>Failed prop type: Invalid prop <code>component</code> of type <code>string</code> supplied
    to <code>Route</code>, expected <code>function</code>.</p>
  </blockquote>
  
  <p>but when I replace project.title with an actual component like Project1:</p>
  
  <pre><code>return &lt;Route key={i} exact path={`/${project.title}`} exact component={Project1}/&gt;
  </code></pre>
  
  <p>then it's fine. </p>
  
  <p>Is there a way I can use the titles of each project, from my reducer, in this function, without this error popping up?</p>
  
  <p>here is the whole container code, in case it's helpful: </p>
  
  <pre><code>import React from 'react';
  import Project1 from '../components/project1.js';
  import { connect } from 'react-redux';
  import { Route, Switch } from 'react-router-dom';
  import { withRouter } from 'react-router';
  import ProjectCards from '../containers/project_cards.js';
  
  class App extends React.Component{
      render() {
          var createRoutes = this.props.projects.map((project, i) =&gt; {
              return &lt;Route key={i} exact path={`/${project.title}`} exact component={project.title}/&gt;
          });
          return (
              &lt;Switch&gt;
                  &lt;Route exact path="/" component={ProjectCards}/&gt;
                  {createRoutes}
              &lt;/Switch&gt;
          );
      }
  }
  
  function mapStateToProps(state) {
      return {
          projects: state.projects
      };
  }
  
  export default withRouter(connect(mapStateToProps)(App));
  </code></pre>