title: React-router TypeError: _this.props.history is undefined
body: <p>I am using react-router with react js and i following their documentation but facing this error</p>
  
  <p>while compiling it shows the error,</p>
  
  <pre><code>TypeError: _this.props.history is undefined
  </code></pre>
  
  <p>this is my index.js file</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  import './index.css';
  import { Router, Route, browserHistory, IndexRoute } from 'react-router';
  
  ReactDOM.render(
    &lt;Router history={browserHistory}&gt;
      &lt;Route path="/" component={App}&gt;
  
      &lt;/Route&gt;
    &lt;/Router&gt;
    ,
    document.getElementById('root')
  );
  </code></pre>
  
  <p>and this is my App.js file</p>
  
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  
  class App extends Component {
      constructor(props){
          super(props);
  
          this.state = {
              headerText: "Props from Header.",
              contentText: "Props from content."
          };
      }
      render() {
          return (
            &lt;div className="App"&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href=""&gt;Home&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=""&gt;Home&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href=""&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          );
      }
  }
  
  export default App;
  </code></pre>