Как перейти к использованию https://cdnjs.cloudflare.com/ajax/libs/react-router/4.0.0-2/react-router.min.js
с помощью https://cdnjs.cloudflare.com/ajax/libs/react-router/3.0.1/ReactRouter.min.js
?
Пример использования 3.x ниже.
HTML
<script src="https://unpkg.com/[email protected]/dist/react.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/react-dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-router/3.0.1/ReactRouter.min.js"></script>
JS
let { Router, IndexRoute, Redirect, Route, Link, browserHistory } = ReactRouter;
history.replaceState(0,0,'/');
const Main = () =>
<Router history={browserHistory}>
<Route path='/' component={App}>
<IndexRoute component={Home}/>
<Route path='map' component={Map}/>
<Route path='settings' component={Settings}/>
<Redirect from='foo' to='/' />
<Route path='*' component={NotFound}/>
</Route>
</Router>
const App = props =>
<div>
<Navigation>
<Link to='/map'>Map</Link>
<Link to='/settings'>Settings</Link>
<Link to='/foo'>Foo</Link>
</Navigation>
{props.children}
</div>
const Navigation = props => <nav {...props} />
const Home = () => <h1>Home</h1>
const Map = () => <h1>Map</h1>
const Settings = () => <h1>Settings</h1>
const NotFound = (props) => <h1>404 - Not Found</h1>
ReactDOM.render(<Main />, document.body);
Посмотрите на действие: https://jsfiddle.net/developit/nvpr63eg/
Если я перейду на любую версию CDX с 4-мя версиями, хотя она не работает (код недоступен после команды возврата).