title: Moving from react router 3.x to 4.x
body: <p>How can I move to using <code>https://cdnjs.cloudflare.com/ajax/libs/react-router/4.0.0-2/react-router.min.js</code> from using <code>https://cdnjs.cloudflare.com/ajax/libs/react-router/3.0.1/ReactRouter.min.js</code>?</p>
  
  <p>Example using 3.x below.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;script src="https://unpkg.com/react@15.4.2/dist/react.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://unpkg.com/react-dom@15.4.2/dist/react-dom.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/react-router/3.0.1/ReactRouter.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>let { Router, IndexRoute, Redirect, Route, Link, browserHistory } = ReactRouter;
  
  history.replaceState(0,0,'/');
  
  const Main = () =&gt;
    &lt;Router history={browserHistory}&gt;
  
      &lt;Route path='/' component={App}&gt;
        &lt;IndexRoute component={Home}/&gt;
        &lt;Route path='map' component={Map}/&gt;
        &lt;Route path='settings' component={Settings}/&gt;
              &lt;Redirect from='foo' to='/' /&gt;
        &lt;Route path='*' component={NotFound}/&gt;
      &lt;/Route&gt;
  
    &lt;/Router&gt;
  
  const App = props =&gt; 
    &lt;div&gt;
      &lt;Navigation&gt;
        &lt;Link to='/map'&gt;Map&lt;/Link&gt;
        &lt;Link to='/settings'&gt;Settings&lt;/Link&gt;
        &lt;Link to='/foo'&gt;Foo&lt;/Link&gt;
      &lt;/Navigation&gt;
  
      {props.children}
  
    &lt;/div&gt;
  
  const Navigation = props =&gt; &lt;nav {...props} /&gt;
  const Home = () =&gt; &lt;h1&gt;Home&lt;/h1&gt;
  const Map = () =&gt; &lt;h1&gt;Map&lt;/h1&gt;
  const Settings = () =&gt; &lt;h1&gt;Settings&lt;/h1&gt;
  const NotFound = (props) =&gt; &lt;h1&gt;404 - Not Found&lt;/h1&gt;
  
  ReactDOM.render(&lt;Main /&gt;, document.body);
  </code></pre>
  
  <p>See it in action at: <a href="https://jsfiddle.net/developit/nvpr63eg/" rel="noreferrer">https://jsfiddle.net/developit/nvpr63eg/</a></p>
  
  <p>If I move to any of the CDN hosted 4.x versions though it doesn't work (unreachable code after return statement).</p>