with a specific command line switch we could have a pure ES6 output, with scopes emitted as lambda expressions instead of functions. E.g.:
var templateRT = function () {
let repeatA1 = (a, aIndex) => React.createElement('div', {});
return React.createElement.apply(this, [
'div',
{},
_.map([1,2,3], repeatA1)
]);
};
The benefit of this could be injecting the render function into the component class source code, and have it syntax checked by the IDE/compiler (I'm thinking mostly of TypeScript).
So for example if you mispell {this.someProp} in your template code, that could be detected by the compiler because it knows exactly what's in this.
with a specific command line switch we could have a pure ES6 output, with scopes emitted as lambda expressions instead of functions. E.g.:
The benefit of this could be injecting the render function into the component class source code, and have it syntax checked by the IDE/compiler (I'm thinking mostly of TypeScript).
So for example if you mispell
{this.someProp}
in your template code, that could be detected by the compiler because it knows exactly what's inthis
.