title: React Router: Cannot read property 'pathname' of undefined
body: <p>I've just started learning React and got stuck at this error. </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'pathname' of undefined
        at new Router </p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>var React = require('react');
  var ReactDOM = require('react-dom');
  var { Route, Router, IndexRoute } = require('react-router');
  var hashHistory = require('react-router-redux')
  
  var Main = require('./components/Main');
  
  ReactDOM.render(
      &lt;Router history={hashHistory}&gt;
          &lt;Route path="/" component={Main}&gt;
  
          &lt;/Route&gt;
      &lt;/Router&gt;,
    document.getElementById('app')
  );
  </code></pre>
  
  <p>The tutorial I was following uses React-Router 2.0.0, but on my desktop I'm using 4.1.1. I tried searching for changes but was unsuccessful in finding a solution that worked.</p>
  
  <pre><code>"dependencies": {
  "express": "^4.15.2",
  "react": "^15.5.4",
  "react-dom": "^15.5.4",
  "react-router": "^4.1.1",
  "react-router-dom": "^4.1.1",
  "react-router-redux": "^4.0.8"
  </code></pre>