title: react-router-dom refresh component when route changes
body: <p>I used same component for different routes. When route changes, I want the component to be rendered.</p>
  
  <pre><code>&lt;Switch&gt;
      &lt;Route exact path="/" component={HomePage} /&gt;
      &lt;Route path="/hotels" component={HotelsPage} /&gt;
      &lt;Route path="/apartments" component={HotelsPage} /&gt;
  &lt;/Switch&gt;
  </code></pre>
  
  <p>When I change the route path from <code>/hotels</code> to <code>/apartments</code>, the component <code>HotelsPage</code> doesn't refresh.</p>
  
  <p>What is the cool approach for this?</p>