Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is obvious, because when you use a component, it's usage is as a single root node.

<component /> should not render multiple root nodes.



  return <h2>label</h2><SubComponent />;
That's illegal and will fail to compile and it's not obvious why that should happen.


Because render is a function, and it should return a single value... because JavaScript.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: