How to use context api with react router v4? : <p>I'm trying here on my application to do some tests with the new context API from React 16.3 but I can't understand why my redirect never works.</p>

<pre><code>&lt;ContextA&gt;
  &lt;Switch&gt;
    &lt;Route exact path='/route1' component={ Component1 } /&gt;
    &lt;ContextB&gt;
      &lt;Route exact path='/route2' component={ Component2 } /&gt;
      &lt;Route exact path='/route3' component={ Component3 } /&gt;
    &lt;/ContextB&gt;
    &lt;Redirect from='/' to='/route1' /&gt;
  &lt;/Switch&gt;
&lt;/ContextA&gt;
</code></pre>

<p>I don't want to have my ContextB available for all the routes, just 2 and 3. How can I do this?</p>
