News for hackers. Stuff that matters.
Re:Rich Harris joins Vercel to work on Svelte full time by bGl2YW5j on Thursday November 11, 2021 @07:23PM (#29194965)
This JSX syntax is a perfect example of one of its subtleties: map() creates an array, and an array of elements is automatically expanded to single elements. I know that when I learnt JSX, this was not intuitive.

The word 'each' conveys the intent of this code way more explicitly.

Re:Rich Harris joins Vercel to work on Svelte full time by wruza on Friday November 12, 2021 @12:29AM (#29196557)
And this subtlety is based on a difference in React.createElement() interface. If you pass an array among its children, it automatically requires all of its items to be keyed, and if you pass it as …array, i.e. variadic arguments, it doesn’t. But I believe you either can’t do {…array.map()} in jsx or its creators decided that it is not tasty enough.