title: Using react-router with typescript
body: <p>I'm attempting to port a small react app over to typescript. </p>
  
  <p>I'm encountering issues with react-router.  I have the latest definitions from definitely type but the following code gives me errors:</p>
  
  <pre><code>var routes:Router.Route = (
  &lt;Route name="root" path="/" handler={MyApp}&gt;
    &lt;Route path="dashboard" handler={MyDash} /&gt;
    &lt;DefaultRoute handler={SomeSection} /&gt;
    &lt;NotFoundRoute handler={NotFoundPage} /&gt;
  &lt;/Route&gt;
  );
  
  Router.run(routes, function (Handler:React.Component&lt;any, any&gt;) {
    React.render(&lt;Handler/&gt;, document.body);
  });
  </code></pre>
  
  <p>These are the compilation errors I get:</p>
  
  <pre><code>js/app.tsx(31,3): error TS2605: JSX element type 'Component&lt;RouteProp, any&gt;' is not a constructor function for JSX elements.
    Property 'render' is missing in type 'Component&lt;RouteProp, any&gt;'.
  js/app.tsx(32,5): error TS2605: JSX element type 'Component&lt;RouteProp, any&gt;' is not a constructor function for JSX elements.
  js/app.tsx(47,5): error TS2605: JSX element type 'Component&lt;DefaultRouteProp, any&gt;' is not a constructor function for JSX elements.
    Property 'render' is missing in type 'Component&lt;DefaultRouteProp, any&gt;'.
  js/app.tsx(49,5): error TS2605: JSX element type 'Component&lt;NotFoundRouteProp, any&gt;' is not a constructor function for JSX elements.
    Property 'render' is missing in type 'Component&lt;NotFoundRouteProp, any&gt;'.
  js/app.tsx(53,20): error TS2345: Argument of type '(Handler: Component&lt;any, any&gt;) =&gt; void' is not assignable to parameter of type '(Handler: RouteClass, state: RouterState) =&gt; void'.
    Types of parameters 'Handler' and 'Handler' are incompatible.
      Type 'Component&lt;any, any&gt;' is not assignable to type 'RouteClass'.
  js/app.tsx(54,17): error TS2604: JSX element type 'Handler' does not have any construct or call signatures.
  </code></pre>
  
  <p>What is the correct way to initialize a set of react-router routes using typescript?</p>
  
  <p>(I should clarify that I'm using a nightly typescript build which has support for JSX via the <code>--jsx react</code> flag</p>