title: React TypeError: __WEBPACK_IMPORTED_MODULE_0_react__.PropTypes is undefined
body: <p>I am making a react app using routers and I'm getting the following error:</p>
  <blockquote>
  <p>React TypeError: <strong>WEBPACK_IMPORTED_MODULE_0_react</strong>.PropTypes is
  undefined</p>
  </blockquote>
  <p>How can I avoid it?</p>
  <p>Here the code for the 2 routers, post and profile:</p>
  <p><strong>Posts</strong></p>
  <pre><code>import React,{Component} from 'react';
  
  
  class Posts extends Component{
      render(){
          return &lt;div&gt;  Posts &lt;/div&gt;
      }
  }
  
  export default Posts;
  </code></pre>
  <p><strong>Profile</strong></p>
  <pre><code>import React,{Component} from 'react';
  
  
  class Profile extends Component{
      render(){
          return &lt;div&gt;  Profile &lt;/div&gt;
      }
  }
  
  export default Profile;
  </code></pre>
  <p><strong>index.js</strong></p>
  <pre><code>import React,{Component} from 'react';
  import ReactDOM from 'react-dom';
  import {BrowserRouter, Route} from 'react-router-dom';
  import PropTypes from 'prop-types';
  
  //COMPONENTS
  import Posts from './Components/posts';
  import Profile from './Components/profile';
  
  
  class App extends Component{
  
      render(){
          return &lt;div&gt; home &lt;/div&gt;
  
      }
  }
  
  
  ReactDOM.render(
      &lt;BrowserRouter&gt;
      &lt;div&gt;
      &lt;Route path=&quot;/posts&quot; component={Posts}&gt;  &lt;/Route&gt;
  
      &lt;Route path=&quot;/profile&quot; component={Profile}&gt;  &lt;/Route&gt;
  
      &lt;/div&gt;
      &lt;/BrowserRouter&gt;
      
      ,document.querySelector('#root'))
  </code></pre>
  <p>Here is a screenshot of the error:</p>
  <p><img src="https://i.imgur.com/6ijKefx.png" alt="error screenshot" /></p>