title: Conditionally render 404 route with React Router v4
body: <p>In my most parent component <code>App</code> I implemented my route like this:</p>
  
  <pre><code>&lt;GetCustomerData /&gt;
  &lt;Switch&gt;
      &lt;Route path="/dashboard/:customerID" component={Dashboard} /&gt;
  &lt;/Switch&gt;
  </code></pre>
  
  <p><code>GetCustomerData</code> gets the customer data as an array of JSON payload (including the customer ID). We navigate to <code>Dashboard</code> component for a specific customer with their corresponding ID.</p>
  
  <p>I want to setup a route which basically throws a 404 component if the customer ID we pass in the URL doesn't exist in the JSON payload in <code>GetCustomerData</code>.</p>
  
  <p>I've seen some tutorials that say to do something like:</p>
  
  <pre><code> &lt;Route path="*" component={NotFound} /&gt;
  </code></pre>
  
  <p>But this doesn't really check for the <code>customerID</code> param in the url. How do I implement this?</p>
  
  <p>EDIT:
  In my main component I have Browser route configured in this way:</p>
  
  <pre><code>ReactDOM.render(
      &lt;BrowserRouter&gt;
          &lt;div className="main"&gt;
              &lt;App /&gt;
          &lt;/div&gt;
      &lt;/BrowserRouter&gt;
      ,
      document.getElementById('react-app')
  );
  </code></pre>