reactjs - How to write your own properties onto react-router's RouteHandler within typescript -
i using ts nightly, able use jsx bits. using react-router typings via definitelytyped (tsd install react-router
).
the following render of main route handler:
render() { var name = this.context.router.getcurrentpath(); return ( <div> <routehandler key={name} hub={this.props.hub} state={this.state} /> </div>); }
this code part has number of issues:
- context has been specified
{}
without chance modify it. i can fiddle around one. - the properties pass onto routehandler not specified on corresponding type...
error ts2339: property 'key' not exist on type 'routehandlerprop'.
...
but understanding properties passed way passed react component rendered handler.
does know can compile in typescript?
context has been specified {} without chance modify it
use fat arrow ()=>
. more : https://www.youtube.com/watch?v=tvocucbcupa
the properties pass onto routehandler not specified on corresponding type
typescript interfaces open ended. add stuff routehandler
interface in vendor.d.ts
:
Comments
Post a Comment