title: Nested Switches with Siblings in react-router
body: <p>I'm running into an issue with react-router.</p>
  
  <p>I have some routes that display a navbar and some that don't, so I created a parent component where I can pass in a prop deciding if I should show the navbar or not.</p>
  
  <p>The expected behavior is that it will go down the routes in order looking for a route that matches in the first Master component and if that doesn't work, then keep going to the next where I actually catch it and redirect to a 404.</p>
  
  <p>What's actually happening is the first one Master component always renders and I get either the Master without navbar heading if I'm at /no_bar and otherwise nothing.</p>
  
  <pre><code>   private routes = (
        &lt;Switch&gt;
           &lt;Route exact path={login} component={Login}/&gt;
           &lt;Route exact path={logout} component={Logout}/&gt;
           &lt;Route exact path={register} component={Register}/&gt;
           &lt;MasterWrapperContainer&gt;
              &lt;Switch&gt;
                 &lt;Master&gt;
                    &lt;Switch&gt;
                       &lt;PrivateRoute exact path="/no_bar" component={() =&gt; &lt;h2&gt;Master without navbar!&lt;/h2&gt;} /&gt;
                       &lt;PrivateRoute exact path="/different_no_bar" component={() =&gt; &lt;h2&gt;Another route without navbar!&lt;/h2&gt;} /&gt;
                       &lt;PrivateRoute exact path="/no_bar3" component={() =&gt; &lt;h2&gt;Yet another Master without navbar!&lt;/h2&gt;} /&gt;
                    &lt;/Switch&gt;
                 &lt;/Master&gt;
                 &lt;Master navbar&gt;
                    &lt;Switch&gt;
                       &lt;PrivateRoute exact path={joinCourse} component={props =&gt; &lt;JoinCourseContainer {...props} /&gt;}/&gt;
                       &lt;PrivateRoute exact path={settings} component={UserSettingsContainer} /&gt;
                       &lt;PrivateRoute exact path={forbidden} component={ErrorDisplay} /&gt;
                       &lt;PrivateRoute exact path={notFound} component={ErrorDisplay} /&gt;
                       &lt;PrivateRoute exact path={serverError} component={ErrorDisplay} /&gt;
                       &lt;Redirect from="*" to={notFound} /&gt;
                    &lt;/Switch&gt;
                 &lt;/Master&gt;
              &lt;/Switch&gt;
           &lt;/MasterWrapperContainer&gt;
        &lt;/Switch&gt;
     );
  </code></pre>