title: react-router location.pathname such as /users/ that matches both /users/profiles and /users/details. /users/* if you may
body: <p>I am using react-router for programatic navigation in my app. All is fine expect for this new feature I want to add, that requires conditional routing. </p>
  
  <p>I need to render, for instance <code>profileRoutes</code> when location is <code>/users/profile</code> and <code>somethingElse</code> when location is <code>/users/details</code> for instance. The code below works fine for now as I only have profileRoutes built. But I consolidated the routes into one, and need <code>/users/*</code> or something to that effect, such that that location would match all routes related to /users/... </p>
  
  <pre><code>
      &lt;Route
      children={({ location }) =&gt; (
      &lt;div&gt;
      {
      location.pathname === "/users/profiles" ?
      &lt;profileRoutes&gt;&lt;/profileRoutes&gt; :
      &lt;otherComponent/&gt;
      }
      &lt;/div&gt;
      )}
      /&gt;
  
  </code></pre>
  
  <p>My question: Is there a react-router way to achieve this? like <code>location.pathname.startswith....</code> sort of thing?</p>