title: React router - undefined history
body: <p>I am trying to use the 1.0.0-rc1 react-router and history 2.0.0-rc1 to navigate manually through the website after pressing the button. Unfortunately, after pressing the button I get:</p>
  
  <blockquote>
    <p>Cannot read property 'pushState' of undefined</p>
  </blockquote>
  
  <p>My router code:</p>
  
  <pre><code>import React from 'react';
  import { Router, Route, Link, browserHistory } from 'react-router'
  import AppContainer from './components/AppContainer.jsx';
  import MyTab from './components/test/MyTab.jsx';
  import MainTab from './components/test/MainTab.jsx';
  
  
  var routes = (
      &lt;Route component={AppContainer} &gt;
          &lt;Route name="maintab" path="/" component={MainTab} /&gt;
          &lt;Route name="mytab" path="/mytab" component={MyTab} /&gt;
      &lt;/Route&gt;
  );
  
  React.render(&lt;Router history={browserHistory}&gt;{routes}&lt;/Router&gt;, document.getElementById('main'));
  </code></pre>
  
  <p>The navigation button is on MyTab and it attemps to navigate to MainTab:</p>
  
  <pre><code>import React from 'react';
  import 'datejs';
  import History from "history";
  export default React.createClass({
  
      mixins: [ History ],
  
      onChange(state) {
          this.setState(state);
      },
  
      handleClick() {
          this.history.pushState(null, `/`)
      },
  
      render() {
          return (
              &lt;div className='container-fluid' &gt;
                  &lt;button type="button" onClick={this.handleClick.bind(this)}&gt;TEST&lt;/button&gt;
              &lt;/div&gt;
  
          );
      }
  });
  </code></pre>
  
  <p>When I use history with <code>this.props.history</code> everything works fine. What is the problem with this code?</p>
  
  <p><strong>EDIT.</strong></p>
  
  <p>After adding the following:</p>
  
  <pre><code>const history = createBrowserHistory();
  
  React.render(&lt;Router history={history}&gt;{routes}&lt;/Router&gt;, document.getElementById('main'));
  </code></pre>
  
  <p>I try to access my app. Before (without history={history}), I just accessed <code>localhost:8080/testapp</code> and everything worked fine - my static resources are generated into <code>dist/testapp</code> directory. Now under this URL I get:</p>
  
  <blockquote>
    <p>Location "/testapp/" did not match any resources</p>
  </blockquote>
  
  <p>I tried to use the useBasename function in a following way:</p>
  
  <pre><code>    import { useBasename } from 'history'
      const history = useBasename(createBrowserHistory)({
      basename: '/testapp'
  });
  
  React.render(&lt;Router history={history}&gt;{routes}&lt;/Router&gt;, document.getElementById('main'));
  </code></pre>
  
  <p>and the application is back, but again I get the error</p>
  
  <blockquote>
    <p>Cannot read property 'pushState' of undefined</p>
  </blockquote>
  
  <p>in the call:</p>
  
  <blockquote>
  <pre><code>handleClick() {
      this.history.pushState(null, `/mytab`)
  },
  </code></pre>
  </blockquote>
  
  <p>I thougt it may be because of my connect task in gulp, so I have added history-api-fallback to configuration:</p>
  
  <pre><code>settings: {
        root: './dist/',
        host: 'localhost',
        port: 8080,
        livereload: {
          port: 35929
        },
        middleware: function(connect, opt){
          return [historyApiFallback({})];
        }
      }
  </code></pre>
  
  <p>But after adding middleware all I get after accessing a website is:</p>
  
  <blockquote>
    <p>Cannot GET /</p>
  </blockquote>