Hacker News new | ask | show | jobs
by hobofan 3128 days ago
Sure, we can call it syntax. Of course, for anyone who already knows what it does, it's just a transform, but the problem with extra syntax is that it makes it harder for newcomers to pick it up.

Taking your example when putting it in front of someone seeing it for the first time:

In: <></>

Out (Newcomer): WTF does that mean? Did someone forget to put something in those tags?

1 comments

Same newcomer, in a couple of weeks: "Don't know how I lived without it".

I understand your point, but in practice people love tiny affordances like this, especially when they are needed as often as fragments are.

This is a balance, but it's important to consider the needs of power users too. Beginners don't stay beginners forever. We've thought about this for a few months, and decided that adding syntax would be better. I understand some people will always disagree though, and that's fine :-)

Yeah, it seems like the decision to make the fragment a first-class JSX concept has a lot to do with portability between renderers. The post makes it clear you all have given this a lot of thought and care, and I appreciate that (even if it will take me awhile to get used to seeing empty tags, haha).