Type safety on react-router Route params possible?

Viewed 2162

Is it possible to access react-router 2.0 Route properties w/TypeScript in a safe manner? For example:

<Router>
  <Route path="/" component={App}>
    <Route path="screenOne" header="Screen One" component={ScreenOne}/>
  </Route>
</Router>

The header value of the screenOne Route can be accessed via 'this.props.route.header', but it doesn't seem possible to both set that and access it using TypeScript without getting warnings that the property doesn't exist on either the Route side or inside the component that accesses the property. I've looked through both the definition files in http://definitelytyped.org/ and https://github.com/typings/typings

1 Answers
Related