3 ms·
Why can't they automatically wrap every bit of JSX with a <Fragment> tag? That way users would need to include an empty tag when they're returning multiple ele
by mcphage 9y ago
Why can't they automatically wrap every bit of JSX with a <Fragment> tag? That way users would need to include an empty tag when they're returning multiple elements, and they're not it'll be a fragment tag that just contains a single element.
- danabramov 9y agoBecause you don't know where JSX ends and code begins. Don't forget that fragments can include text nodes too. return <div /> // am I a comment? Or text after div?
- mcphage 9y agoAh, hmm... good catch.