title: Warning: Failed prop type: Invalid prop 'component' supplied to 'Route' - react-router-dom
body: <p>I want to solve this warning. I get this warning once I added react-router-dom to App.js.
  (The application itself is working fine with this warning.)</p>
  
  <p>Warning message:</p>
  
  <pre><code>index.js:1 Warning: Failed prop type: Invalid prop 'component' supplied to 'Route': the prop is not a valid React component
      in Route (at App.js:34)
      in App (at src/index.js:9)
      in Router (created by HashRouter)
      in HashRouter (at src/index.js:8)
  </code></pre>
  
  <p>I'm just passing down the state down to the child component form App.js
  App.js</p>
  
  <pre><code>import React, { Component } from 'react'
  import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
  import './App.css'
  import MasterPassword from './MasterPassword'
  import EncryptForm from './EncryptForm'
  import NotFound from './NotFound'
  
  class App extends Component {
    constructor(props) {
      super(props)
      this.state = {
        masterPassword: null
      }
    }
  
    getMasterPassword = userPassword =&gt; {
      this.setState({
        masterPassword: userPassword
      })
    }
  
    render() {
      return (
        &lt;Router&gt;
          {!this.state.masterPassword
          ? &lt;MasterPassword
              path='/ask-password'
              masterPassword={this.state.masterPassword}
              onStorePassword={this.getMasterPassword}
            /&gt;
          : &lt;div className="App"&gt;
              &lt;Switch&gt;
                &lt;Route exact path='/' render={() =&gt; &lt;EncryptForm masterPassword={this.state.masterPassword} /&gt;} /&gt;
                &lt;Route component={&lt;NotFound /&gt;} /&gt;
              &lt;/Switch&gt;
            &lt;/div&gt;}
        &lt;/Router&gt;
      )
    } 
  }
  
  export default App
  
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>import React from 'react'
  import ReactDOM from 'react-dom'
  import { HashRouter } from 'react-router-dom' 
  import './index.css'
  import App from './components/App'
  import * as serviceWorker from './serviceWorker'
  
  ReactDOM.render(&lt;HashRouter&gt;
          &lt;App /&gt;
      &lt;/HashRouter&gt;, document.getElementById('root'))
  
  serviceWorker.unregister()
  </code></pre>
  
  <p>Thank you!</p>