title: react router v^4.0.0 Uncaught TypeError: Cannot read property 'location' of undefined
body: <p>I've been having some trouble with react router (i'm using version^4.0.0).</p>
  
  <p>this is my index.js</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  import './index.css';
  import { Router, Route, Link, browserHistory } from 'react-router';
  
  
  ReactDOM.render(
    &lt;Router history={browserHistory} &gt;
      &lt;Route path="/" component={App} /&gt;
  
    &lt;/Router&gt;,
    document.getElementById('root')
  );
  </code></pre>
  
  <p>the App.js is just anything. i'm posting the basic one here, cause it's not the problem (i believe) </p>
  
  <pre><code>import React, { Component } from 'react';
  import logo from './logo.svg';
  import './App.css';
  
  class App extends Component {
    render() {
      return (
        &lt;div className="App"&gt;
          &lt;div className="App-header"&gt;
            &lt;img src={logo} className="App-logo" alt="logo" /&gt;
            &lt;h2&gt;Welcome to React&lt;/h2&gt;
          &lt;/div&gt;
          &lt;p className="App-intro"&gt;
            To get started, edit &lt;code&gt;src/App.js&lt;/code&gt; and save to reload.
          &lt;/p&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p>and this is what happens when i check the console log</p>
  
  <pre><code>Router.js:43 Uncaught TypeError: Cannot read property 'location' of undefined
      at new Router (Router.js:43)
      at ReactCompositeComponent.js:295
      at measureLifeCyclePerf (ReactCompositeComponent.js:75)
      at ReactCompositeComponentWrapper._constructComponentWithoutOwner (ReactCompositeComponent.js:294)
      at ReactCompositeComponentWrapper._constructComponent (ReactCompositeComponent.js:280)
      at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:188)
      at Object.mountComponent (ReactReconciler.js:46)
      at ReactCompositeComponentWrapper.performInitialMount (ReactCompositeComponent.js:371)
      at ReactCompositeComponentWrapper.mountComponent (ReactCompositeComponent.js:258)
      at Object.mountComponent (ReactReconciler.js:46)
  </code></pre>
  
  <p>oh, and this is the package.json just in case</p>
  
  <pre><code>{
    "name": "teste2",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "react": "^15.4.2",
      "react-dom": "^15.4.2",
      "react-router": "^4.0.0"
    },
    "devDependencies": {
      "react-scripts": "0.9.5"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test --env=jsdom",
      "eject": "react-scripts eject"
    }
  }
  </code></pre>
  
  <p>i've been checking this on other places, but i didn't find a way to solve it. </p>
  
  <p>Thank you guys very much for your patience and help!!</p>