hyperapp: Lazy components cannot return arrays
var h = hyperapp.h, app = hyperapp.app;
/*@jsx h*/
var SomeComponent = function () {
return function () {
return [<p>Hello</p>];
};
};
app({}, {}, function () {
return (<div oncreate={function (e) {
setTimeout(function () { alert(e.innerHTML); }, 0); // <undefined></undefined> would be alerted.
}}>
<SomeComponent/>
</div>);
}, document.getElementById("app"));
See JSFiddle: https://jsfiddle.net/vmvaywrr/2/
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Add test for lazy components (#695) — committed to infinnie/hyperapp by infinnie 6 years ago
- Lazy components return arrays: https://github.com/hyperapp/hyperapp/issues/695 — committed to infinnie/countertest by infinnie 6 years ago
- Fix #695 only — committed to infinnie/hyperapp by infinnie 6 years ago
Yes, https://github.com/hyperapp/hyperapp/pull/684/commits/981ed354681d1d07feec2273447962d6d53d7cb8 for the diff and https://github.com/hyperapp/hyperapp/pull/684/commits/f6c3322e0f6b3b61ee3d8ecf32abdbbe8dae17df for the test.
Array.isArray()
is ES5, supported by IE9Correct. By the way, lazy components will be removed in 2.0.