Closed jridgewell closed 7 years ago
If the key is not the first computed attribute, we will eagerly evaluate any attributes that came before it avoid a bug in the compiling. Ie:
key
var i = 0; function render() { return <div attr={i++} key={i++} />; }
Will now evaluate the attr’s value before the key’s value and rewrite the nodes to the eagerly evaluate expression.
attr
var _div$statics = ["key", ""]; var i = 0; function render() { var _attr, _ref; _attr = i++; return elementVoid("div", _ref = i++, (_div$statics[1] = _ref, _div$statics), "attr", _attr); }
Fixes #83.
If the
key
is not the first computed attribute, we will eagerly evaluate any attributes that came before it avoid a bug in the compiling. Ie:Will now evaluate the
attr
’s value before thekey
’s value and rewrite the nodes to the eagerly evaluate expression.Fixes #83.