TypeScript 2.0 allows to annotate the this context for functions, so it would possible for react-templates to emit a render() function that is type checked versus the React.Component it will be attached to.
That allows TypeScript users to catch lot of errors that otherwise would be discovered only at run time.
From my early experiments: (notice the this: component argument)
declare function h(...a:any[]);
import _ = require('lodash');
// imports the type
import component from './mycomponent';
var render = function(this: component) {
function scopeData8(this: component) {
// ...
}
return h('div',{},scopeData8.apply(this, []))
};
export = render;
TypeScript 2.0 allows to annotate the
this
context for functions, so it would possible for react-templates to emit arender()
function that is type checked versus theReact.Component
it will be attached to.That allows TypeScript users to catch lot of errors that otherwise would be discovered only at run time.
From my early experiments: (notice the
this: component
argument)