title: Check if react-router path is active
body: <p>How to check if generic react-router path matches current location pathname?</p>
  
  <pre><code>react-router path: /Movies/:id
  location.pathname: /Movies/56fa7446bae6eb301e5937f3
  </code></pre>
  
  <p>I want to use route paths with menu buttons, to set class="active".</p>
  
  <p>EDIT: </p>
  
  <p>To clarify, paths in my app look like:</p>
  
  <pre><code>/Movies/56fa7/watch
  </code></pre>
  
  <p>and not like:</p>
  
  <pre><code>/Movies/watch/56fa7
  </code></pre>
  
  <p>How do I check if the former route is active?</p>
  
  <p>Is it doable without <code>&lt;Link&gt;</code> component? </p>
  
  <p><code>/Movies/56fa7/watch</code> is arbitrary after <code>/Movies</code>, and <code>&lt;Link&gt;</code> obviously can't be pointed to an arbitrary location. So let's ignore <code>&lt;Link&gt;</code> for a moment:</p>
  
  <p>Is there a standalone function or property in react-router that checks if <code>/Movies/:id/watch</code> is active?</p>