title: Testing react component within react router
body: <p>I want to test react component:</p>
  
  <pre><code>export class IdentityPage extends React.Component&lt;PageProps, State&gt; {
      constructor(props: PageProps) {
          super(props);
      }
  
      componentDidMount() { this.reload(this.props.routeParams.id); }
      render(){....}
  }
  </code></pre>
  
  <p>which is used in react router like this:</p>
  
  <pre><code>&lt;Router history={hashHistory}&gt;
      &lt;Route path="/"&gt;
          &lt;Route path="Identities"&gt;
              &lt;Route path=":action/:id" component={IdentityPage} /&gt;
          &lt;/Route&gt;
      &lt;/Route&gt;
  &lt;/Router&gt;
  </code></pre>
  
  <p>However, the test fails with:</p>
  
  <blockquote>
    <p>Cannot read property 'id' of undefined</p>
  </blockquote>
  
  <p>when I try to run:</p>
  
  <pre><code>let pageProps: PageProps = {
      params: {
          action: "view",
          id: "0"
      }
  };
  let instance = TestUtils.renderIntoDocument(React.createElement(IdentityPage, pageProps));
  </code></pre>