title: Attempted import error: 'PrivateRoute' is not exported from 'react-router-dom'
body: <p>I try to create a <code>PrivateRoute</code> use <code>react-router-dom</code> <a href="https://reacttraining.com/react-router/web/example/auth-workflow" rel="nofollow noreferrer">like this example</a> and I have an ERROR like this:</p>
  
  <pre><code>Attempted import error: 'PrivateRoute' is not exported from 'react-router-dom'.
  </code></pre>
  
  <p><br>
  react: <strong>16.12.0</strong> <br>
  react-router-dom: <strong>5.1.2</strong></p>
  
  <p><br>
  <br>
  in <strong>index.js</strong> I am import <code>BrowserRoute</code> and use them in <code>ReactDOM.render()</code> like this:</p>
  
  <pre><code>ReactDOM.render(
    &lt;BrowserRouter&gt;&lt;App /&gt;&lt;/BrowserRouter&gt;,
    document.getElementById('root')
  );
  </code></pre>
  
  <p>and in <strong>App.js</strong> I render <code>&lt;Home /&gt;</code> Component like this:</p>
  
  <pre><code>function App() {
    return (
      &lt;div className="App"&gt;
        &lt;Home /&gt;
      &lt;/div&gt;
    );
  }
  </code></pre>
  
  <p>then I Import the <code>PrivateRouter</code> from react-router-dom in <code>&lt;Home /&gt;</code> Component like this:</p>
  
  <pre><code>import { 
    Switch,
    // Route,
    PrivateRoute 
  } from 'react-router-dom';
  </code></pre>
  
  <p>and I use <code>PrivateRoute</code> inside <code>render()</code> function like this:</p>
  
  <pre><code>&lt;Switch&gt;
    &lt;PrivateRoute path="/customer"&gt;
      &lt;RootContent 
        displayContent="CUSTOMER" 
        responseCode={this.state.responseCode}
        responseStatus={this.state.responseStatus}
        responseMessage={this.state.responseMessage}
        responseData={this.state.responseData}
        getApiSuccess={this.state.getApiSuccess}
        USER_TOKEN={this.state.USER_TOKEN}
      /&gt;
    &lt;/PrivateRoute&gt;
  &lt;/Switch&gt;
  </code></pre>
  
  <p><br>
  <br>
  I still new in ReactJS. <br>
  I hope you can help me, thanks.</p>