title: React Router - Cannot read property 'history' of undefined
body: <p>I am building a styleguide app. I have two dropdown components where a user can choose both a brand and a component - the app will then display the chosen component branded according to the selected brand. I want both of these options to be included in the URL.</p>
  
  <p>The two dropdown's that are programatically changing the route. I am getting the error TypeError: Cannot read property 'history' of undefined whenever the user interacts with either dropdown.</p>
  
  <p>I have a component being rendered by a route :</p>
  
  <pre><code>&lt;Route path="/:brand/:component"
  render={props =&gt; &lt;DisplayComponent {...props} /&gt;} /&gt;
  </code></pre>
  
  <p>That component has two event handlers for two dropdown component that let the user select the root: </p>
  
  <pre><code>  handleComponentPick(event: any) {
      const component = event.target.value;
      this.props.history.push(`/${this.props.match.params.brand}/${component}`);
    }
  
    handleBrandChange = (event: any) =&gt; {
      if (event.target instanceof HTMLElement) {
        const brand = event.target.value;
        this.props.history.push(`/${brand}/${this.props.match.params.component}`);
      }
    };
    render = () =&gt; {
      return (
        &lt;div className={"constrain-width-wide center "}&gt;
          &lt;ThemePicker
            component={this.props.match.params.component}
            brand={this.props.match.params.brand}
            handleBrandChange={this.handleBrandChange}
            handleComponentPick={this.handleComponentPick}
          /&gt;
          &lt;div className="currently-selected-component" /&gt;
          &lt;Route path="/:brand/button" component={Button} /&gt;
          &lt;Route path="/:brand/card" component={Card} /&gt;
        &lt;/div&gt;
      );
    };
  }
  </code></pre>
  
  <p>I am wrapping the whole app in the <code>Router</code>.</p>
  
  <pre><code>ReactDOM.render(
    &lt;Router&gt;
      &lt;App /&gt;
    &lt;/Router&gt;,
    document.getElementById("root")
  );```
  </code></pre>