I have a Parent component that takes a bunch of children elements and simply returns them. Hyperapp throws length of undefined in the createElement function.
Codepen: https://codepen.io/rajaraodv/pen/VMqBNB
Note:
view function.<undefined>...children elements... </undefined>Expected: It should render the children elements.
const { h, app } = hyperapp;
/** @jsx h */
const Parent = ({ state, actions }, children) => {
return children; //<-- returning w/o "{" "}" causes error in Hyperapp
};
app({
state: {
count: 0
},
view: (state, actions) => (
<Parent state={state} actions={actions}>
<h1>raja</h1>
<h2> rao</h2>
</Parent>
)
});

This only happens if the main Parent component is not itself wrapped in something but is the main/direct element for the view function.
This is a known limitation of hyperapp. Components may return arrays, but view specifically may not
@rajaraodv I still don't understand what you expect Hyperapp to do here.
<undefined></undefined> is weird though; maybe we should make this issue about only that oddity.
Thoughts?
Yeah, probably moving this to #417 is a good idea since there is nothing Hyperapp can do other than warn people.
Most helpful comment
This is a known limitation of hyperapp. Components may return arrays, but
viewspecifically may not