Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
ceedan
11y ago
0 comments
Save
Share
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.
0 comments
2 comments · 1 top-level
top
newest
oldest
tootie
11y ago
· 1 in thread
return <h2>label</h2><SubComponent />;
That's illegal and will fail to compile and it's not obvious why that should happen.
ceedan
OP
11y ago
Because render is a function, and it should return a single value... because JavaScript.
j
/
k
navigate · click thread line to collapse